diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md b/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md index 7e6ab4e79b95..186f0b4de18d 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md +++ b/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md @@ -1,5 +1,95 @@ # Release History +## 2.4.0-beta.1 (2025-05-01) +### Features Added + +- New value `ChannelProvisioningStateIdleDueToMirroredPartnerDestinationDeletion` added to enum type `ChannelProvisioningState` +- New value `ChannelTypePartnerDestination` added to enum type `ChannelType` +- New value `EndpointTypePartnerDestination` added to enum type `EndpointType` +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New enum type `AlternativeAuthenticationNameSource` with values `AlternativeAuthenticationNameSourceClientCertificateDNS`, `AlternativeAuthenticationNameSourceClientCertificateEmail`, `AlternativeAuthenticationNameSourceClientCertificateIP`, `AlternativeAuthenticationNameSourceClientCertificateSubject`, `AlternativeAuthenticationNameSourceClientCertificateURI` +- New enum type `CustomJwtAuthenticationManagedIdentityType` with values `CustomJwtAuthenticationManagedIdentityTypeSystemAssigned`, `CustomJwtAuthenticationManagedIdentityTypeUserAssigned` +- New enum type `CustomWebhookAuthenticationManagedIdentityType` with values `CustomWebhookAuthenticationManagedIdentityTypeSystemAssigned`, `CustomWebhookAuthenticationManagedIdentityTypeUserAssigned` +- New enum type `NetworkSecurityPerimeterAssociationAccessMode` with values `NetworkSecurityPerimeterAssociationAccessModeAudit`, `NetworkSecurityPerimeterAssociationAccessModeEnforced`, `NetworkSecurityPerimeterAssociationAccessModeLearning` +- New enum type `NetworkSecurityPerimeterConfigProvisioningState` with values `NetworkSecurityPerimeterConfigProvisioningStateAccepted`, `NetworkSecurityPerimeterConfigProvisioningStateCanceled`, `NetworkSecurityPerimeterConfigProvisioningStateCreating`, `NetworkSecurityPerimeterConfigProvisioningStateDeleted`, `NetworkSecurityPerimeterConfigProvisioningStateDeleting`, `NetworkSecurityPerimeterConfigProvisioningStateFailed`, `NetworkSecurityPerimeterConfigProvisioningStateSucceeded`, `NetworkSecurityPerimeterConfigProvisioningStateUpdating` +- New enum type `NetworkSecurityPerimeterConfigurationIssueSeverity` with values `NetworkSecurityPerimeterConfigurationIssueSeverityError`, `NetworkSecurityPerimeterConfigurationIssueSeverityWarning` +- New enum type `NetworkSecurityPerimeterConfigurationIssueType` with values `NetworkSecurityPerimeterConfigurationIssueTypeConfigurationPropagationFailure`, `NetworkSecurityPerimeterConfigurationIssueTypeMissingIdentityConfiguration`, `NetworkSecurityPerimeterConfigurationIssueTypeMissingPerimeterConfiguration`, `NetworkSecurityPerimeterConfigurationIssueTypeOther` +- New enum type `NetworkSecurityPerimeterProfileAccessRuleDirection` with values `NetworkSecurityPerimeterProfileAccessRuleDirectionInbound`, `NetworkSecurityPerimeterProfileAccessRuleDirectionOutbound` +- New enum type `NetworkSecurityPerimeterResourceType` with values `NetworkSecurityPerimeterResourceTypeDomains`, `NetworkSecurityPerimeterResourceTypeTopics` +- New enum type `PartnerClientAuthenticationType` with values `PartnerClientAuthenticationTypeAzureAD` +- New enum type `PartnerDestinationActivationState` with values `PartnerDestinationActivationStateActivated`, `PartnerDestinationActivationStateNeverActivated` +- New enum type `PartnerDestinationProvisioningState` with values `PartnerDestinationProvisioningStateCanceled`, `PartnerDestinationProvisioningStateCreating`, `PartnerDestinationProvisioningStateDeleting`, `PartnerDestinationProvisioningStateFailed`, `PartnerDestinationProvisioningStateIdleDueToMirroredChannelResourceDeletion`, `PartnerDestinationProvisioningStateSucceeded`, `PartnerDestinationProvisioningStateUpdating` +- New enum type `PartnerEndpointType` with values `PartnerEndpointTypeWebHook` +- New enum type `ResourceKind` with values `ResourceKindAzure`, `ResourceKindAzureArc` +- New enum type `SKU` with values `SKUBasic`, `SKUPremium` +- New function `*AzureADPartnerClientAuthentication.GetPartnerClientAuthentication() *PartnerClientAuthentication` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient` +- New function `*ClientFactory.NewPartnerDestinationsClient() *PartnerDestinationsClient` +- New function `*PartnerClientAuthentication.GetPartnerClientAuthentication() *PartnerClientAuthentication` +- New function `*PartnerDestinationInfo.GetPartnerDestinationInfo() *PartnerDestinationInfo` +- New function `NewPartnerDestinationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PartnerDestinationsClient, error)` +- New function `*PartnerDestinationsClient.Activate(context.Context, string, string, *PartnerDestinationsClientActivateOptions) (PartnerDestinationsClientActivateResponse, error)` +- New function `*PartnerDestinationsClient.BeginCreateOrUpdate(context.Context, string, string, PartnerDestination, *PartnerDestinationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PartnerDestinationsClientCreateOrUpdateResponse], error)` +- New function `*PartnerDestinationsClient.BeginDelete(context.Context, string, string, *PartnerDestinationsClientBeginDeleteOptions) (*runtime.Poller[PartnerDestinationsClientDeleteResponse], error)` +- New function `*PartnerDestinationsClient.Get(context.Context, string, string, *PartnerDestinationsClientGetOptions) (PartnerDestinationsClientGetResponse, error)` +- New function `*PartnerDestinationsClient.NewListByResourceGroupPager(string, *PartnerDestinationsClientListByResourceGroupOptions) *runtime.Pager[PartnerDestinationsClientListByResourceGroupResponse]` +- New function `*PartnerDestinationsClient.NewListBySubscriptionPager(*PartnerDestinationsClientListBySubscriptionOptions) *runtime.Pager[PartnerDestinationsClientListBySubscriptionResponse]` +- New function `*PartnerDestinationsClient.BeginUpdate(context.Context, string, string, PartnerDestinationUpdateParameters, *PartnerDestinationsClientBeginUpdateOptions) (*runtime.Poller[PartnerDestinationsClientUpdateResponse], error)` +- New function `*PartnerEventSubscriptionDestination.GetEventSubscriptionDestination() *EventSubscriptionDestination` +- New function `*PartnerUpdateDestinationInfo.GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo` +- New function `*WebhookPartnerDestinationInfo.GetPartnerDestinationInfo() *PartnerDestinationInfo` +- New function `*WebhookUpdatePartnerDestinationInfo.GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo` +- New function `NewNetworkSecurityPerimeterConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.Get(context.Context, string, NetworkSecurityPerimeterResourceType, string, string, string, *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.NewListPager(string, NetworkSecurityPerimeterResourceType, string, *NetworkSecurityPerimeterConfigurationsClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListResponse]` +- New function `*NetworkSecurityPerimeterConfigurationsClient.BeginReconcile(context.Context, string, NetworkSecurityPerimeterResourceType, string, string, string, *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error)` +- New struct `AzureADPartnerClientAuthentication` +- New struct `AzureADPartnerClientAuthenticationProperties` +- New struct `ClientAuthenticationSettings` +- New struct `CustomJwtAuthenticationManagedIdentity` +- New struct `CustomJwtAuthenticationSettings` +- New struct `CustomWebhookAuthenticationManagedIdentity` +- New struct `EncodedIssuerCertificateInfo` +- New struct `ExtendedLocation` +- New struct `FederatedIdentityCredentialInfo` +- New struct `IssuerCertificateInfo` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationIssues` +- New struct `NetworkSecurityPerimeterConfigurationIssuesProperties` +- New struct `NetworkSecurityPerimeterConfigurationList` +- New struct `NetworkSecurityPerimeterConfigurationProfile` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `NetworkSecurityPerimeterInfo` +- New struct `NetworkSecurityPerimeterProfileAccessRule` +- New struct `NetworkSecurityPerimeterProfileAccessRuleProperties` +- New struct `NetworkSecurityPerimeterSubscription` +- New struct `PartnerDestination` +- New struct `PartnerDestinationProperties` +- New struct `PartnerDestinationUpdateParameters` +- New struct `PartnerDestinationsListResult` +- New struct `PartnerEventSubscriptionDestination` +- New struct `PartnerEventSubscriptionDestinationProperties` +- New struct `ResourceAssociation` +- New struct `ResourceMoveChangeHistory` +- New struct `ResourceSKU` +- New struct `WebhookAuthenticationSettings` +- New struct `WebhookPartnerDestinationInfo` +- New struct `WebhookPartnerDestinationProperties` +- New struct `WebhookUpdatePartnerDestinationInfo` +- New field `PartnerDestinationInfo` in struct `ChannelProperties` +- New field `PartnerDestinationInfo` in struct `ChannelUpdateParametersProperties` +- New field `SKU` in struct `Domain` +- New field `SKU` in struct `DomainUpdateParameters` +- New field `FederatedIdentityCredentialInfo` in struct `EventSubscriptionIdentity` +- New field `Tags` in struct `SubscriptionProperties` +- New field `Tags` in struct `SubscriptionUpdateParametersProperties` +- New field `ExtendedLocation`, `Kind`, `SKU` in struct `Topic` +- New field `ClientAuthentication` in struct `TopicSpacesConfiguration` +- New field `SKU` in struct `TopicUpdateParameters` +- New field `ClientAuthentication` in struct `UpdateTopicSpacesConfigurationInfo` +- New field `PartnerDestinationDetails` in struct `VerifiedPartnerProperties` + + ## 2.3.0 (2025-03-28) ### Features Added diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md b/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md index 92880f87badc..95b6845ef5a6 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md +++ b/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/eventgrid/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/eventgrid/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.3.0 -tag: package-2025-02 +module-version: 2.4.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client.go index 2e77081c3cc9..d3c421a79270 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client.go @@ -45,7 +45,7 @@ func NewCaCertificatesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Create or update a CA certificate with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - caCertificateName - The CA certificate name. @@ -73,7 +73,7 @@ func (client *CaCertificatesClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Create or update a CA certificate with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *CaCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, caCertificateInfo CaCertificate, options *CaCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CaCertificatesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *CaCertificatesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, caCertificateInfo); err != nil { @@ -131,7 +131,7 @@ func (client *CaCertificatesClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Delete an existing CA certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - caCertificateName - Name of the CA certificate. @@ -158,7 +158,7 @@ func (client *CaCertificatesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete an existing CA certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *CaCertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, options *CaCertificatesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CaCertificatesClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *CaCertificatesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *CaCertificatesClient) deleteCreateRequest(ctx context.Context, res // Get - Get properties of a CA certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - caCertificateName - Name of the CA certificate. @@ -264,7 +264,7 @@ func (client *CaCertificatesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *CaCertificatesClient) getHandleResponse(resp *http.Response) (CaCe // NewListByNamespacePager - Get all the CA certificates under a namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - CaCertificatesClientListByNamespaceOptions contains the optional parameters for the CaCertificatesClient.NewListByNamespacePager @@ -335,7 +335,7 @@ func (client *CaCertificatesClient) listByNamespaceCreateRequest(ctx context.Con if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client_example_test.go deleted file mode 100644 index 2be66d642f66..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client_example_test.go +++ /dev/null @@ -1,155 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_Get.json -func ExampleCaCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCaCertificatesClient().Get(ctx, "examplerg", "exampleNamespaceName1", "exampleCACertificateName1", 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.CaCertificate = armeventgrid.CaCertificate{ - // Name: to.Ptr("exampleCACertificateName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/caCertificates"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/caCertificates/exampleCACertificateName1"), - // Properties: &armeventgrid.CaCertificateProperties{ - // Description: to.Ptr("This is a test Root certificate"), - // EncodedCertificate: to.Ptr("base64EncodePemFormattedCertificateString"), - // ExpiryTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-12T23:06:43.000Z"); return t}()), - // IssueTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T23:06:43.000Z"); return t}()), - // ProvisioningState: to.Ptr(armeventgrid.CaCertificateProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_CreateOrUpdate.json -func ExampleCaCertificatesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCaCertificatesClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleNamespaceName1", "exampleCACertificateName1", armeventgrid.CaCertificate{ - Properties: &armeventgrid.CaCertificateProperties{ - Description: to.Ptr("This is a test certificate"), - EncodedCertificate: to.Ptr("base64EncodePemFormattedCertificateString"), - }, - }, 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.CaCertificate = armeventgrid.CaCertificate{ - // Name: to.Ptr("exampleCACertificateName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/caCertificates"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/caCertificates/exampleCACertificateName1"), - // Properties: &armeventgrid.CaCertificateProperties{ - // Description: to.Ptr("This is a test Root certificate"), - // EncodedCertificate: to.Ptr("base64EncodePemFormattedCertificateString"), - // ExpiryTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-12T23:06:43.000Z"); return t}()), - // IssueTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T23:06:43.000Z"); return t}()), - // ProvisioningState: to.Ptr(armeventgrid.CaCertificateProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_Delete.json -func ExampleCaCertificatesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCaCertificatesClient().BeginDelete(ctx, "examplerg", "exampleNamespaceName1", "exampleCACertificateName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_ListByNamespace.json -func ExampleCaCertificatesClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCaCertificatesClient().NewListByNamespacePager("examplerg", "namespace123", &armeventgrid.CaCertificatesClientListByNamespaceOptions{Filter: nil, - Top: 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.CaCertificatesListResult = armeventgrid.CaCertificatesListResult{ - // Value: []*armeventgrid.CaCertificate{ - // { - // Name: to.Ptr("exampleCACertificateName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/caCertificates"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/caCertificates/exampleCACertificateName1"), - // Properties: &armeventgrid.CaCertificateProperties{ - // Description: to.Ptr("This is a test Root certificate"), - // EncodedCertificate: to.Ptr("base64EncodePemFormattedCertificateString"), - // ExpiryTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-12T23:06:43.000Z"); return t}()), - // IssueTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-12T23:06:43.000Z"); return t}()), - // ProvisioningState: to.Ptr(armeventgrid.CaCertificateProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go index 4b108b8ae3fb..a4158e7974c9 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go @@ -45,7 +45,7 @@ func NewChannelsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Synchronously creates or updates a new channel with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -97,7 +97,7 @@ func (client *ChannelsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, channelInfo); err != nil { @@ -118,7 +118,7 @@ func (client *ChannelsClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Delete an existing channel. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -143,7 +143,7 @@ func (client *ChannelsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete an existing channel. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *ChannelsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ChannelsClient.BeginDelete" @@ -189,7 +189,7 @@ func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -197,7 +197,7 @@ func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get properties of a channel. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -248,7 +248,7 @@ func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,7 @@ func (client *ChannelsClient) getHandleResponse(resp *http.Response) (ChannelsCl // GetFullURL - Get the full endpoint URL of a partner destination channel. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the Channel. @@ -317,7 +317,7 @@ func (client *ChannelsClient) getFullURLCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +334,7 @@ func (client *ChannelsClient) getFullURLHandleResponse(resp *http.Response) (Cha // NewListByPartnerNamespacePager - List all the channels in a partner namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - options - ChannelsClientListByPartnerNamespaceOptions contains the optional parameters for the ChannelsClient.NewListByPartnerNamespacePager @@ -388,7 +388,7 @@ func (client *ChannelsClient) listByPartnerNamespaceCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -406,7 +406,7 @@ func (client *ChannelsClient) listByPartnerNamespaceHandleResponse(resp *http.Re // Update - Synchronously updates a channel with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -457,7 +457,7 @@ func (client *ChannelsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, channelUpdateParameters); err != nil { return nil, err diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/channels_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/channels_client_example_test.go deleted file mode 100644 index 69fb0c8ba8df..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/channels_client_example_test.go +++ /dev/null @@ -1,220 +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 armeventgrid_test - -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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Get.json -func ExampleChannelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().Get(ctx, "examplerg", "examplePartnerNamespaceName1", "exampleChannelName1", 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.Channel = armeventgrid.Channel{ - // Name: to.Ptr("exampleChannelName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerNamespaces/channels"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerNamespaces/examplePartnerNamespaceName1/changes/exampleChannelName1"), - // Properties: &armeventgrid.ChannelProperties{ - // ChannelType: to.Ptr(armeventgrid.ChannelTypePartnerTopic), - // ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-21T22:50:25.410Z"); return t}()), - // MessageForActivation: to.Ptr("Example message to approver"), - // PartnerTopicInfo: &armeventgrid.PartnerTopicInfo{ - // Name: to.Ptr("examplePartnerTopic1"), - // AzureSubscriptionID: to.Ptr("5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), - // ResourceGroupName: to.Ptr("examplerg2"), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ChannelProvisioningStateSucceeded), - // ReadinessState: to.Ptr(armeventgrid.ReadinessStateNeverActivated), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_CreateOrUpdate.json -func ExampleChannelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().CreateOrUpdate(ctx, "examplerg", "examplePartnerNamespaceName1", "exampleChannelName1", armeventgrid.Channel{ - Properties: &armeventgrid.ChannelProperties{ - ChannelType: to.Ptr(armeventgrid.ChannelTypePartnerTopic), - ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-21T22:50:25.410Z"); return t }()), - MessageForActivation: to.Ptr("Example message to approver"), - PartnerTopicInfo: &armeventgrid.PartnerTopicInfo{ - Name: to.Ptr("examplePartnerTopic1"), - AzureSubscriptionID: to.Ptr("5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), - ResourceGroupName: to.Ptr("examplerg2"), - Source: to.Ptr("ContosoCorp.Accounts.User1"), - }, - }, - }, 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.Channel = armeventgrid.Channel{ - // Name: to.Ptr("exampleChannelName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerNamespaces/channels"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerNamespaces/examplePartnerNamespaceName1/changes/exampleChannelName1"), - // Properties: &armeventgrid.ChannelProperties{ - // ChannelType: to.Ptr(armeventgrid.ChannelTypePartnerTopic), - // ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-21T22:50:25.410Z"); return t}()), - // MessageForActivation: to.Ptr("Example message to approver"), - // PartnerTopicInfo: &armeventgrid.PartnerTopicInfo{ - // Name: to.Ptr("examplePartnerTopic1"), - // AzureSubscriptionID: to.Ptr("5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), - // ResourceGroupName: to.Ptr("examplerg2"), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Delete.json -func ExampleChannelsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewChannelsClient().BeginDelete(ctx, "examplerg", "examplePartnerNamespaceName1", "exampleEventChannelName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Update.json -func ExampleChannelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewChannelsClient().Update(ctx, "examplerg", "examplePartnerNamespaceName1", "exampleChannelName1", armeventgrid.ChannelUpdateParameters{ - Properties: &armeventgrid.ChannelUpdateParametersProperties{ - ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T23:06:11.785Z"); return t }()), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_ListByPartnerNamespace.json -func ExampleChannelsClient_NewListByPartnerNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewChannelsClient().NewListByPartnerNamespacePager("examplerg", "examplePartnerNamespaceName1", &armeventgrid.ChannelsClientListByPartnerNamespaceOptions{Filter: nil, - Top: 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.ChannelsListResult = armeventgrid.ChannelsListResult{ - // Value: []*armeventgrid.Channel{ - // { - // Name: to.Ptr("exampleChannelName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerNamespaces/channels"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerNamespaces/examplePartnerNamespaceName1/changes/exampleChannelName1"), - // Properties: &armeventgrid.ChannelProperties{ - // ChannelType: to.Ptr(armeventgrid.ChannelTypePartnerTopic), - // ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-21T22:50:25.410Z"); return t}()), - // MessageForActivation: to.Ptr("Example message to approver"), - // PartnerTopicInfo: &armeventgrid.PartnerTopicInfo{ - // Name: to.Ptr("examplePartnerTopic1"), - // AzureSubscriptionID: to.Ptr("5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), - // ResourceGroupName: to.Ptr("examplerg2"), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ChannelProvisioningStateSucceeded), - // ReadinessState: to.Ptr(armeventgrid.ReadinessStateNeverActivated), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_GetFullUrl.json -func ExampleChannelsClient_GetFullURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChannelsClient().GetFullURL(ctx, "examplerg", "examplenamespace", "examplechannel", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/client_factory.go b/sdk/resourcemanager/eventgrid/armeventgrid/client_factory.go index 02006f4fb7fc..2e612aa12537 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/client_factory.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/client_factory.go @@ -137,6 +137,14 @@ func (c *ClientFactory) NewNamespacesClient() *NamespacesClient { } } +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient. +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + return &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { return &OperationsClient{ @@ -152,6 +160,14 @@ func (c *ClientFactory) NewPartnerConfigurationsClient() *PartnerConfigurationsC } } +// NewPartnerDestinationsClient creates a new instance of PartnerDestinationsClient. +func (c *ClientFactory) NewPartnerDestinationsClient() *PartnerDestinationsClient { + return &PartnerDestinationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewPartnerNamespacesClient creates a new instance of PartnerNamespacesClient. func (c *ClientFactory) NewPartnerNamespacesClient() *PartnerNamespacesClient { return &PartnerNamespacesClient{ diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client.go index d736663c4fed..ceaa894d25d9 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client.go @@ -45,7 +45,7 @@ func NewClientGroupsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or update a client group with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - clientGroupName - The client group name. @@ -73,7 +73,7 @@ func (client *ClientGroupsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or update a client group with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *ClientGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, clientGroupInfo ClientGroup, options *ClientGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ClientGroupsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *ClientGroupsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, clientGroupInfo); err != nil { @@ -131,7 +131,7 @@ func (client *ClientGroupsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete an existing client group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - clientGroupName - Name of the client group. @@ -158,7 +158,7 @@ func (client *ClientGroupsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete an existing client group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *ClientGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, options *ClientGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ClientGroupsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *ClientGroupsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *ClientGroupsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get properties of a client group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - clientGroupName - Name of the client group. @@ -264,7 +264,7 @@ func (client *ClientGroupsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *ClientGroupsClient) getHandleResponse(resp *http.Response) (Client // NewListByNamespacePager - Get all the client groups under a namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - ClientGroupsClientListByNamespaceOptions contains the optional parameters for the ClientGroupsClient.NewListByNamespacePager @@ -335,7 +335,7 @@ func (client *ClientGroupsClient) listByNamespaceCreateRequest(ctx context.Conte if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client_example_test.go deleted file mode 100644 index 013c619b94ca..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client_example_test.go +++ /dev/null @@ -1,146 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_Get.json -func ExampleClientGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClientGroupsClient().Get(ctx, "examplerg", "exampleNamespaceName1", "exampleClientGroupName1", 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.ClientGroup = armeventgrid.ClientGroup{ - // Name: to.Ptr("exampleClientGroupName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/clientGroups"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clientGroups/exampleClientGroupName1"), - // Properties: &armeventgrid.ClientGroupProperties{ - // Description: to.Ptr("This is a test client group"), - // Query: to.Ptr("attributes.b IN ['a', 'b', 'c']"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_CreateOrUpdate.json -func ExampleClientGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClientGroupsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleNamespaceName1", "exampleClientGroupName1", armeventgrid.ClientGroup{ - Properties: &armeventgrid.ClientGroupProperties{ - Description: to.Ptr("This is a test client group"), - Query: to.Ptr("attributes.b IN ['a', 'b', 'c']"), - }, - }, 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.ClientGroup = armeventgrid.ClientGroup{ - // Name: to.Ptr("exampleClientGroupName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/clientGroups"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clientGroups/exampleClientGroupName1"), - // Properties: &armeventgrid.ClientGroupProperties{ - // Description: to.Ptr("This is a test client group"), - // Query: to.Ptr("attributes.b IN ['a', 'b', 'c']"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_Delete.json -func ExampleClientGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClientGroupsClient().BeginDelete(ctx, "examplerg", "exampleNamespaceName1", "exampleClientGroupName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_ListByNamespace.json -func ExampleClientGroupsClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClientGroupsClient().NewListByNamespacePager("examplerg", "namespace123", &armeventgrid.ClientGroupsClientListByNamespaceOptions{Filter: nil, - Top: 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.ClientGroupsListResult = armeventgrid.ClientGroupsListResult{ - // Value: []*armeventgrid.ClientGroup{ - // { - // Name: to.Ptr("exampleClientGroupName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/clientGroups"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clientGroups/exampleClientGroupName1"), - // Properties: &armeventgrid.ClientGroupProperties{ - // Description: to.Ptr("This is a test client group"), - // Query: to.Ptr("attributes.b IN ['a', 'b', 'c']"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/clients_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/clients_client.go index cd7fe590bf04..cdcd4bcd3912 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/clients_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/clients_client.go @@ -45,7 +45,7 @@ func NewClientsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a client with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - clientName - The client name. @@ -73,7 +73,7 @@ func (client *ClientsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Create or update a client with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *ClientsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, clientInfo Client, options *ClientsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ClientsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *ClientsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, clientInfo); err != nil { @@ -131,7 +131,7 @@ func (client *ClientsClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Delete an existing client. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - clientName - Name of the client. @@ -157,7 +157,7 @@ func (client *ClientsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete an existing client. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *ClientsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, options *ClientsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ClientsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *ClientsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *ClientsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Get properties of a client. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - clientName - Name of the client. @@ -263,7 +263,7 @@ func (client *ClientsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *ClientsClient) getHandleResponse(resp *http.Response) (ClientsClie // NewListByNamespacePager - Get all the permission bindings under a namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - ClientsClientListByNamespaceOptions contains the optional parameters for the ClientsClient.NewListByNamespacePager @@ -334,7 +334,7 @@ func (client *ClientsClient) listByNamespaceCreateRequest(ctx context.Context, r if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/clients_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/clients_client_example_test.go deleted file mode 100644 index bdfb0ddf7028..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/clients_client_example_test.go +++ /dev/null @@ -1,194 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_Get.json -func ExampleClientsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClientsClient().Get(ctx, "examplerg", "exampleNamespaceName1", "exampleClientName1", 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.Client = armeventgrid.Client{ - // Name: to.Ptr("exampleClientName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/clients"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clients/exampleClientName1"), - // Properties: &armeventgrid.ClientProperties{ - // Description: to.Ptr("This is a test client"), - // Attributes: map[string]any{ - // "deviceTypes": []any{ - // "Light", - // "1", - // }, - // "floor": float64(3), - // "room": "345a", - // }, - // ClientCertificateAuthentication: &armeventgrid.ClientCertificateAuthentication{ - // ValidationScheme: to.Ptr(armeventgrid.ClientCertificateValidationSchemeSubjectMatchesAuthenticationName), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ClientProvisioningStateSucceeded), - // State: to.Ptr(armeventgrid.ClientStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_CreateOrUpdate.json -func ExampleClientsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClientsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleNamespaceName1", "exampleClientName1", armeventgrid.Client{ - Properties: &armeventgrid.ClientProperties{ - Description: to.Ptr("This is a test client"), - Attributes: map[string]any{ - "deviceTypes": []any{ - "Fan", - "Light", - "AC", - }, - "floor": float64(3), - "room": "345", - }, - ClientCertificateAuthentication: &armeventgrid.ClientCertificateAuthentication{ - ValidationScheme: to.Ptr(armeventgrid.ClientCertificateValidationSchemeSubjectMatchesAuthenticationName), - }, - State: to.Ptr(armeventgrid.ClientStateEnabled), - }, - }, 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.Client = armeventgrid.Client{ - // Name: to.Ptr("exampleClientName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/clients"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clients/exampleClientName1"), - // Properties: &armeventgrid.ClientProperties{ - // Description: to.Ptr("This is a test client"), - // Attributes: map[string]any{ - // "deviceTypes": []any{ - // "Light", - // "1", - // }, - // "floor": float64(3), - // "room": "345a", - // }, - // ClientCertificateAuthentication: &armeventgrid.ClientCertificateAuthentication{ - // ValidationScheme: to.Ptr(armeventgrid.ClientCertificateValidationSchemeSubjectMatchesAuthenticationName), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ClientProvisioningStateSucceeded), - // State: to.Ptr(armeventgrid.ClientStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_Delete.json -func ExampleClientsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClientsClient().BeginDelete(ctx, "examplerg", "exampleNamespaceName1", "exampleClientName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_ListByNamespace.json -func ExampleClientsClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClientsClient().NewListByNamespacePager("examplerg", "namespace123", &armeventgrid.ClientsClientListByNamespaceOptions{Filter: nil, - Top: 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.ClientsListResult = armeventgrid.ClientsListResult{ - // Value: []*armeventgrid.Client{ - // { - // Name: to.Ptr("exampleClientName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/clients"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/clients/exampleClientName1"), - // Properties: &armeventgrid.ClientProperties{ - // Description: to.Ptr("This is a test client"), - // Attributes: map[string]any{ - // "deviceTypes": []any{ - // "Light", - // "1", - // }, - // "floor": float64(3), - // "room": "345a", - // }, - // ClientCertificateAuthentication: &armeventgrid.ClientCertificateAuthentication{ - // ValidationScheme: to.Ptr(armeventgrid.ClientCertificateValidationSchemeSubjectMatchesAuthenticationName), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ClientProvisioningStateSucceeded), - // State: to.Ptr(armeventgrid.ClientStateEnabled), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/constants.go b/sdk/resourcemanager/eventgrid/armeventgrid/constants.go index 6a2f8c0ffc93..54bf064ef7df 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/constants.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/constants.go @@ -7,7 +7,7 @@ package armeventgrid const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" - moduleVersion = "v2.3.0" + moduleVersion = "v2.4.0-beta.1" ) // AdvancedFilterOperatorType - The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -60,6 +60,29 @@ func PossibleAdvancedFilterOperatorTypeValues() []AdvancedFilterOperatorType { } } +// AlternativeAuthenticationNameSource - Alternative authentication name sources related to client authentication settings +// for namespace resource. +type AlternativeAuthenticationNameSource string + +const ( + AlternativeAuthenticationNameSourceClientCertificateDNS AlternativeAuthenticationNameSource = "ClientCertificateDns" + AlternativeAuthenticationNameSourceClientCertificateEmail AlternativeAuthenticationNameSource = "ClientCertificateEmail" + AlternativeAuthenticationNameSourceClientCertificateIP AlternativeAuthenticationNameSource = "ClientCertificateIp" + AlternativeAuthenticationNameSourceClientCertificateSubject AlternativeAuthenticationNameSource = "ClientCertificateSubject" + AlternativeAuthenticationNameSourceClientCertificateURI AlternativeAuthenticationNameSource = "ClientCertificateUri" +) + +// PossibleAlternativeAuthenticationNameSourceValues returns the possible values for the AlternativeAuthenticationNameSource const type. +func PossibleAlternativeAuthenticationNameSourceValues() []AlternativeAuthenticationNameSource { + return []AlternativeAuthenticationNameSource{ + AlternativeAuthenticationNameSourceClientCertificateDNS, + AlternativeAuthenticationNameSourceClientCertificateEmail, + AlternativeAuthenticationNameSourceClientCertificateIP, + AlternativeAuthenticationNameSourceClientCertificateSubject, + AlternativeAuthenticationNameSourceClientCertificateURI, + } +} + // CaCertificateProvisioningState - Provisioning state of the CA Certificate resource. type CaCertificateProvisioningState string @@ -90,13 +113,14 @@ func PossibleCaCertificateProvisioningStateValues() []CaCertificateProvisioningS type ChannelProvisioningState string const ( - ChannelProvisioningStateCanceled ChannelProvisioningState = "Canceled" - ChannelProvisioningStateCreating ChannelProvisioningState = "Creating" - ChannelProvisioningStateDeleting ChannelProvisioningState = "Deleting" - ChannelProvisioningStateFailed ChannelProvisioningState = "Failed" - ChannelProvisioningStateIdleDueToMirroredPartnerTopicDeletion ChannelProvisioningState = "IdleDueToMirroredPartnerTopicDeletion" - ChannelProvisioningStateSucceeded ChannelProvisioningState = "Succeeded" - ChannelProvisioningStateUpdating ChannelProvisioningState = "Updating" + ChannelProvisioningStateCanceled ChannelProvisioningState = "Canceled" + ChannelProvisioningStateCreating ChannelProvisioningState = "Creating" + ChannelProvisioningStateDeleting ChannelProvisioningState = "Deleting" + ChannelProvisioningStateFailed ChannelProvisioningState = "Failed" + ChannelProvisioningStateIdleDueToMirroredPartnerDestinationDeletion ChannelProvisioningState = "IdleDueToMirroredPartnerDestinationDeletion" + ChannelProvisioningStateIdleDueToMirroredPartnerTopicDeletion ChannelProvisioningState = "IdleDueToMirroredPartnerTopicDeletion" + ChannelProvisioningStateSucceeded ChannelProvisioningState = "Succeeded" + ChannelProvisioningStateUpdating ChannelProvisioningState = "Updating" ) // PossibleChannelProvisioningStateValues returns the possible values for the ChannelProvisioningState const type. @@ -106,6 +130,7 @@ func PossibleChannelProvisioningStateValues() []ChannelProvisioningState { ChannelProvisioningStateCreating, ChannelProvisioningStateDeleting, ChannelProvisioningStateFailed, + ChannelProvisioningStateIdleDueToMirroredPartnerDestinationDeletion, ChannelProvisioningStateIdleDueToMirroredPartnerTopicDeletion, ChannelProvisioningStateSucceeded, ChannelProvisioningStateUpdating, @@ -116,12 +141,14 @@ func PossibleChannelProvisioningStateValues() []ChannelProvisioningState { type ChannelType string const ( - ChannelTypePartnerTopic ChannelType = "PartnerTopic" + ChannelTypePartnerDestination ChannelType = "PartnerDestination" + ChannelTypePartnerTopic ChannelType = "PartnerTopic" ) // PossibleChannelTypeValues returns the possible values for the ChannelType const type. func PossibleChannelTypeValues() []ChannelType { return []ChannelType{ + ChannelTypePartnerDestination, ChannelTypePartnerTopic, } } @@ -274,6 +301,38 @@ func PossibleCustomDomainValidationStateValues() []CustomDomainValidationState { } } +// CustomJwtAuthenticationManagedIdentityType - The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. +type CustomJwtAuthenticationManagedIdentityType string + +const ( + CustomJwtAuthenticationManagedIdentityTypeSystemAssigned CustomJwtAuthenticationManagedIdentityType = "SystemAssigned" + CustomJwtAuthenticationManagedIdentityTypeUserAssigned CustomJwtAuthenticationManagedIdentityType = "UserAssigned" +) + +// PossibleCustomJwtAuthenticationManagedIdentityTypeValues returns the possible values for the CustomJwtAuthenticationManagedIdentityType const type. +func PossibleCustomJwtAuthenticationManagedIdentityTypeValues() []CustomJwtAuthenticationManagedIdentityType { + return []CustomJwtAuthenticationManagedIdentityType{ + CustomJwtAuthenticationManagedIdentityTypeSystemAssigned, + CustomJwtAuthenticationManagedIdentityTypeUserAssigned, + } +} + +// CustomWebhookAuthenticationManagedIdentityType - The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. +type CustomWebhookAuthenticationManagedIdentityType string + +const ( + CustomWebhookAuthenticationManagedIdentityTypeSystemAssigned CustomWebhookAuthenticationManagedIdentityType = "SystemAssigned" + CustomWebhookAuthenticationManagedIdentityTypeUserAssigned CustomWebhookAuthenticationManagedIdentityType = "UserAssigned" +) + +// PossibleCustomWebhookAuthenticationManagedIdentityTypeValues returns the possible values for the CustomWebhookAuthenticationManagedIdentityType const type. +func PossibleCustomWebhookAuthenticationManagedIdentityTypeValues() []CustomWebhookAuthenticationManagedIdentityType { + return []CustomWebhookAuthenticationManagedIdentityType{ + CustomWebhookAuthenticationManagedIdentityTypeSystemAssigned, + CustomWebhookAuthenticationManagedIdentityTypeUserAssigned, + } +} + // DataResidencyBoundary - Data Residency Boundary of the resource. type DataResidencyBoundary string @@ -402,15 +461,16 @@ func PossibleDomainTopicProvisioningStateValues() []DomainTopicProvisioningState type EndpointType string const ( - EndpointTypeAzureFunction EndpointType = "AzureFunction" - EndpointTypeEventHub EndpointType = "EventHub" - EndpointTypeHybridConnection EndpointType = "HybridConnection" - EndpointTypeMonitorAlert EndpointType = "MonitorAlert" - EndpointTypeNamespaceTopic EndpointType = "NamespaceTopic" - EndpointTypeServiceBusQueue EndpointType = "ServiceBusQueue" - EndpointTypeServiceBusTopic EndpointType = "ServiceBusTopic" - EndpointTypeStorageQueue EndpointType = "StorageQueue" - EndpointTypeWebHook EndpointType = "WebHook" + EndpointTypeAzureFunction EndpointType = "AzureFunction" + EndpointTypeEventHub EndpointType = "EventHub" + EndpointTypeHybridConnection EndpointType = "HybridConnection" + EndpointTypeMonitorAlert EndpointType = "MonitorAlert" + EndpointTypeNamespaceTopic EndpointType = "NamespaceTopic" + EndpointTypePartnerDestination EndpointType = "PartnerDestination" + EndpointTypeServiceBusQueue EndpointType = "ServiceBusQueue" + EndpointTypeServiceBusTopic EndpointType = "ServiceBusTopic" + EndpointTypeStorageQueue EndpointType = "StorageQueue" + EndpointTypeWebHook EndpointType = "WebHook" ) // PossibleEndpointTypeValues returns the possible values for the EndpointType const type. @@ -421,6 +481,7 @@ func PossibleEndpointTypeValues() []EndpointType { EndpointTypeHybridConnection, EndpointTypeMonitorAlert, EndpointTypeNamespaceTopic, + EndpointTypePartnerDestination, EndpointTypeServiceBusQueue, EndpointTypeServiceBusTopic, EndpointTypeStorageQueue, @@ -721,6 +782,134 @@ func PossibleNamespaceTopicProvisioningStateValues() []NamespaceTopicProvisionin } } +// NetworkSecurityPerimeterAssociationAccessMode - Network security perimeter access mode. +type NetworkSecurityPerimeterAssociationAccessMode string + +const ( + NetworkSecurityPerimeterAssociationAccessModeAudit NetworkSecurityPerimeterAssociationAccessMode = "Audit" + NetworkSecurityPerimeterAssociationAccessModeEnforced NetworkSecurityPerimeterAssociationAccessMode = "Enforced" + NetworkSecurityPerimeterAssociationAccessModeLearning NetworkSecurityPerimeterAssociationAccessMode = "Learning" +) + +// PossibleNetworkSecurityPerimeterAssociationAccessModeValues returns the possible values for the NetworkSecurityPerimeterAssociationAccessMode const type. +func PossibleNetworkSecurityPerimeterAssociationAccessModeValues() []NetworkSecurityPerimeterAssociationAccessMode { + return []NetworkSecurityPerimeterAssociationAccessMode{ + NetworkSecurityPerimeterAssociationAccessModeAudit, + NetworkSecurityPerimeterAssociationAccessModeEnforced, + NetworkSecurityPerimeterAssociationAccessModeLearning, + } +} + +// NetworkSecurityPerimeterConfigProvisioningState - Provisioning state to reflect configuration state and indicate status +// of nsp profile configuration retrieval. +type NetworkSecurityPerimeterConfigProvisioningState string + +const ( + NetworkSecurityPerimeterConfigProvisioningStateAccepted NetworkSecurityPerimeterConfigProvisioningState = "Accepted" + NetworkSecurityPerimeterConfigProvisioningStateCanceled NetworkSecurityPerimeterConfigProvisioningState = "Canceled" + NetworkSecurityPerimeterConfigProvisioningStateCreating NetworkSecurityPerimeterConfigProvisioningState = "Creating" + NetworkSecurityPerimeterConfigProvisioningStateDeleted NetworkSecurityPerimeterConfigProvisioningState = "Deleted" + NetworkSecurityPerimeterConfigProvisioningStateDeleting NetworkSecurityPerimeterConfigProvisioningState = "Deleting" + NetworkSecurityPerimeterConfigProvisioningStateFailed NetworkSecurityPerimeterConfigProvisioningState = "Failed" + NetworkSecurityPerimeterConfigProvisioningStateSucceeded NetworkSecurityPerimeterConfigProvisioningState = "Succeeded" + NetworkSecurityPerimeterConfigProvisioningStateUpdating NetworkSecurityPerimeterConfigProvisioningState = "Updating" +) + +// PossibleNetworkSecurityPerimeterConfigProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigProvisioningState const type. +func PossibleNetworkSecurityPerimeterConfigProvisioningStateValues() []NetworkSecurityPerimeterConfigProvisioningState { + return []NetworkSecurityPerimeterConfigProvisioningState{ + NetworkSecurityPerimeterConfigProvisioningStateAccepted, + NetworkSecurityPerimeterConfigProvisioningStateCanceled, + NetworkSecurityPerimeterConfigProvisioningStateCreating, + NetworkSecurityPerimeterConfigProvisioningStateDeleted, + NetworkSecurityPerimeterConfigProvisioningStateDeleting, + NetworkSecurityPerimeterConfigProvisioningStateFailed, + NetworkSecurityPerimeterConfigProvisioningStateSucceeded, + NetworkSecurityPerimeterConfigProvisioningStateUpdating, + } +} + +// NetworkSecurityPerimeterConfigurationIssueSeverity - Provisioning issue severity. +type NetworkSecurityPerimeterConfigurationIssueSeverity string + +const ( + NetworkSecurityPerimeterConfigurationIssueSeverityError NetworkSecurityPerimeterConfigurationIssueSeverity = "Error" + NetworkSecurityPerimeterConfigurationIssueSeverityWarning NetworkSecurityPerimeterConfigurationIssueSeverity = "Warning" +) + +// PossibleNetworkSecurityPerimeterConfigurationIssueSeverityValues returns the possible values for the NetworkSecurityPerimeterConfigurationIssueSeverity const type. +func PossibleNetworkSecurityPerimeterConfigurationIssueSeverityValues() []NetworkSecurityPerimeterConfigurationIssueSeverity { + return []NetworkSecurityPerimeterConfigurationIssueSeverity{ + NetworkSecurityPerimeterConfigurationIssueSeverityError, + NetworkSecurityPerimeterConfigurationIssueSeverityWarning, + } +} + +// NetworkSecurityPerimeterConfigurationIssueType - Provisioning issue type. +type NetworkSecurityPerimeterConfigurationIssueType string + +const ( + NetworkSecurityPerimeterConfigurationIssueTypeConfigurationPropagationFailure NetworkSecurityPerimeterConfigurationIssueType = "ConfigurationPropagationFailure" + NetworkSecurityPerimeterConfigurationIssueTypeMissingIdentityConfiguration NetworkSecurityPerimeterConfigurationIssueType = "MissingIdentityConfiguration" + NetworkSecurityPerimeterConfigurationIssueTypeMissingPerimeterConfiguration NetworkSecurityPerimeterConfigurationIssueType = "MissingPerimeterConfiguration" + NetworkSecurityPerimeterConfigurationIssueTypeOther NetworkSecurityPerimeterConfigurationIssueType = "Other" +) + +// PossibleNetworkSecurityPerimeterConfigurationIssueTypeValues returns the possible values for the NetworkSecurityPerimeterConfigurationIssueType const type. +func PossibleNetworkSecurityPerimeterConfigurationIssueTypeValues() []NetworkSecurityPerimeterConfigurationIssueType { + return []NetworkSecurityPerimeterConfigurationIssueType{ + NetworkSecurityPerimeterConfigurationIssueTypeConfigurationPropagationFailure, + NetworkSecurityPerimeterConfigurationIssueTypeMissingIdentityConfiguration, + NetworkSecurityPerimeterConfigurationIssueTypeMissingPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationIssueTypeOther, + } +} + +// NetworkSecurityPerimeterProfileAccessRuleDirection - NSP access rule direction. +type NetworkSecurityPerimeterProfileAccessRuleDirection string + +const ( + NetworkSecurityPerimeterProfileAccessRuleDirectionInbound NetworkSecurityPerimeterProfileAccessRuleDirection = "Inbound" + NetworkSecurityPerimeterProfileAccessRuleDirectionOutbound NetworkSecurityPerimeterProfileAccessRuleDirection = "Outbound" +) + +// PossibleNetworkSecurityPerimeterProfileAccessRuleDirectionValues returns the possible values for the NetworkSecurityPerimeterProfileAccessRuleDirection const type. +func PossibleNetworkSecurityPerimeterProfileAccessRuleDirectionValues() []NetworkSecurityPerimeterProfileAccessRuleDirection { + return []NetworkSecurityPerimeterProfileAccessRuleDirection{ + NetworkSecurityPerimeterProfileAccessRuleDirectionInbound, + NetworkSecurityPerimeterProfileAccessRuleDirectionOutbound, + } +} + +type NetworkSecurityPerimeterResourceType string + +const ( + NetworkSecurityPerimeterResourceTypeDomains NetworkSecurityPerimeterResourceType = "domains" + NetworkSecurityPerimeterResourceTypeTopics NetworkSecurityPerimeterResourceType = "topics" +) + +// PossibleNetworkSecurityPerimeterResourceTypeValues returns the possible values for the NetworkSecurityPerimeterResourceType const type. +func PossibleNetworkSecurityPerimeterResourceTypeValues() []NetworkSecurityPerimeterResourceType { + return []NetworkSecurityPerimeterResourceType{ + NetworkSecurityPerimeterResourceTypeDomains, + NetworkSecurityPerimeterResourceTypeTopics, + } +} + +// PartnerClientAuthenticationType - Type of client authentication +type PartnerClientAuthenticationType string + +const ( + PartnerClientAuthenticationTypeAzureAD PartnerClientAuthenticationType = "AzureAD" +) + +// PossiblePartnerClientAuthenticationTypeValues returns the possible values for the PartnerClientAuthenticationType const type. +func PossiblePartnerClientAuthenticationTypeValues() []PartnerClientAuthenticationType { + return []PartnerClientAuthenticationType{ + PartnerClientAuthenticationTypeAzureAD, + } +} + // PartnerConfigurationProvisioningState - Provisioning state of the partner configuration. type PartnerConfigurationProvisioningState string @@ -745,6 +934,62 @@ func PossiblePartnerConfigurationProvisioningStateValues() []PartnerConfiguratio } } +// PartnerDestinationActivationState - Activation state of the partner destination. +type PartnerDestinationActivationState string + +const ( + PartnerDestinationActivationStateActivated PartnerDestinationActivationState = "Activated" + PartnerDestinationActivationStateNeverActivated PartnerDestinationActivationState = "NeverActivated" +) + +// PossiblePartnerDestinationActivationStateValues returns the possible values for the PartnerDestinationActivationState const type. +func PossiblePartnerDestinationActivationStateValues() []PartnerDestinationActivationState { + return []PartnerDestinationActivationState{ + PartnerDestinationActivationStateActivated, + PartnerDestinationActivationStateNeverActivated, + } +} + +// PartnerDestinationProvisioningState - Provisioning state of the partner destination. +type PartnerDestinationProvisioningState string + +const ( + PartnerDestinationProvisioningStateCanceled PartnerDestinationProvisioningState = "Canceled" + PartnerDestinationProvisioningStateCreating PartnerDestinationProvisioningState = "Creating" + PartnerDestinationProvisioningStateDeleting PartnerDestinationProvisioningState = "Deleting" + PartnerDestinationProvisioningStateFailed PartnerDestinationProvisioningState = "Failed" + PartnerDestinationProvisioningStateIdleDueToMirroredChannelResourceDeletion PartnerDestinationProvisioningState = "IdleDueToMirroredChannelResourceDeletion" + PartnerDestinationProvisioningStateSucceeded PartnerDestinationProvisioningState = "Succeeded" + PartnerDestinationProvisioningStateUpdating PartnerDestinationProvisioningState = "Updating" +) + +// PossiblePartnerDestinationProvisioningStateValues returns the possible values for the PartnerDestinationProvisioningState const type. +func PossiblePartnerDestinationProvisioningStateValues() []PartnerDestinationProvisioningState { + return []PartnerDestinationProvisioningState{ + PartnerDestinationProvisioningStateCanceled, + PartnerDestinationProvisioningStateCreating, + PartnerDestinationProvisioningStateDeleting, + PartnerDestinationProvisioningStateFailed, + PartnerDestinationProvisioningStateIdleDueToMirroredChannelResourceDeletion, + PartnerDestinationProvisioningStateSucceeded, + PartnerDestinationProvisioningStateUpdating, + } +} + +// PartnerEndpointType - Type of the endpoint for the partner destination +type PartnerEndpointType string + +const ( + PartnerEndpointTypeWebHook PartnerEndpointType = "WebHook" +) + +// PossiblePartnerEndpointTypeValues returns the possible values for the PartnerEndpointType const type. +func PossiblePartnerEndpointTypeValues() []PartnerEndpointType { + return []PartnerEndpointType{ + PartnerEndpointTypeWebHook, + } +} + // PartnerNamespaceProvisioningState - Provisioning state of the partner namespace. type PartnerNamespaceProvisioningState string @@ -941,8 +1186,9 @@ func PossiblePrivateEndpointConnectionsParentTypeValues() []PrivateEndpointConne type PublicNetworkAccess string const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -950,6 +1196,7 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, } } @@ -983,6 +1230,22 @@ func PossibleReadinessStateValues() []ReadinessState { } } +// ResourceKind - Kind of the resource. +type ResourceKind string + +const ( + ResourceKindAzure ResourceKind = "Azure" + ResourceKindAzureArc ResourceKind = "AzureArc" +) + +// PossibleResourceKindValues returns the possible values for the ResourceKind const type. +func PossibleResourceKindValues() []ResourceKind { + return []ResourceKind{ + ResourceKindAzure, + ResourceKindAzureArc, + } +} + // ResourceProvisioningState - Provisioning state of the Private Endpoint Connection. type ResourceProvisioningState string @@ -1041,6 +1304,22 @@ func PossibleRoutingIdentityTypeValues() []RoutingIdentityType { } } +// SKU - The Sku name of the resource. The possible values are: Basic or Premium. +type SKU string + +const ( + SKUBasic SKU = "Basic" + SKUPremium SKU = "Premium" +) + +// PossibleSKUValues returns the possible values for the SKU const type. +func PossibleSKUValues() []SKU { + return []SKU{ + SKUBasic, + SKUPremium, + } +} + // SKUName - The name of the SKU. type SKUName string diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go index 24b580fd90b9..bd1b2dba3de1 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go @@ -45,7 +45,7 @@ func NewDomainEventSubscriptionsClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain topic. // - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 64 @@ -73,7 +73,7 @@ func (client *DomainEventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DomainEventSubscriptionsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *DomainEventSubscriptionsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionInfo); err != nil { @@ -131,7 +131,7 @@ func (client *DomainEventSubscriptionsClient) createOrUpdateCreateRequest(ctx co // BeginDelete - Delete an existing event subscription for a domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - eventSubscriptionName - Name of the event subscription to be deleted. @@ -157,7 +157,7 @@ func (client *DomainEventSubscriptionsClient) BeginDelete(ctx context.Context, r // Delete - Delete an existing event subscription for a domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DomainEventSubscriptionsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *DomainEventSubscriptionsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,7 +211,7 @@ func (client *DomainEventSubscriptionsClient) deleteCreateRequest(ctx context.Co // Get - Get properties of an event subscription of a domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - eventSubscriptionName - Name of the event subscription to be found. @@ -263,7 +263,7 @@ func (client *DomainEventSubscriptionsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *DomainEventSubscriptionsClient) getHandleResponse(resp *http.Respo // GetDeliveryAttributes - Get all delivery attributes for an event subscription for domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - eventSubscriptionName - Name of the event subscription. @@ -333,7 +333,7 @@ func (client *DomainEventSubscriptionsClient) getDeliveryAttributesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *DomainEventSubscriptionsClient) getDeliveryAttributesHandleRespons // GetFullURL - Get the full endpoint URL for an event subscription for domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain topic. // - eventSubscriptionName - Name of the event subscription. @@ -403,7 +403,7 @@ func (client *DomainEventSubscriptionsClient) getFullURLCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -420,7 +420,7 @@ func (client *DomainEventSubscriptionsClient) getFullURLHandleResponse(resp *htt // NewListPager - List all event subscriptions that have been created for a specific topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - options - DomainEventSubscriptionsClientListOptions contains the optional parameters for the DomainEventSubscriptionsClient.NewListPager @@ -474,7 +474,7 @@ func (client *DomainEventSubscriptionsClient) listCreateRequest(ctx context.Cont if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,7 +492,7 @@ func (client *DomainEventSubscriptionsClient) listHandleResponse(resp *http.Resp // BeginUpdate - Update an existing event subscription for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - eventSubscriptionName - Name of the event subscription to be updated. @@ -519,7 +519,7 @@ func (client *DomainEventSubscriptionsClient) BeginUpdate(ctx context.Context, r // Update - Update an existing event subscription for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DomainEventSubscriptionsClient.BeginUpdate" @@ -565,7 +565,7 @@ func (client *DomainEventSubscriptionsClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client_example_test.go deleted file mode 100644 index 4037de165f1b..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client_example_test.go +++ /dev/null @@ -1,322 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainEventSubscriptions_GetDeliveryAttributes.json -func ExampleDomainEventSubscriptionsClient_GetDeliveryAttributes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainEventSubscriptionsClient().GetDeliveryAttributes(ctx, "examplerg", "exampleDomain1", "examplesubscription1", 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.DeliveryAttributeListResult = armeventgrid.DeliveryAttributeListResult{ - // Value: []armeventgrid.DeliveryAttributeMappingClassification{ - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header1"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(false), - // Value: to.Ptr("NormalValue"), - // }, - // }, - // &armeventgrid.DynamicDeliveryAttributeMapping{ - // Name: to.Ptr("header2"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeDynamic), - // Properties: &armeventgrid.DynamicDeliveryAttributeMappingProperties{ - // SourceField: to.Ptr("data.foo"), - // }, - // }, - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header3"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(true), - // Value: to.Ptr("mySecretValue"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainEventSubscriptions_Get.json -func ExampleDomainEventSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainEventSubscriptionsClient().Get(ctx, "examplerg", "exampleDomain1", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainEventSubscriptions_CreateOrUpdate.json -func ExampleDomainEventSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleDomain1", "exampleEventSubscriptionName1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("exampleEventSubscriptionName1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/eventSubscriptions/exampleEventSubscriptionName1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainEventSubscriptions_Delete.json -func ExampleDomainEventSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainEventSubscriptionsClient().BeginDelete(ctx, "examplerg", "exampleDomain1", "examplesubscription1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainEventSubscriptions_Update.json -func ExampleDomainEventSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainEventSubscriptionsClient().BeginUpdate(ctx, "examplerg", "exampleDomain1", "exampleEventSubscriptionName1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainEventSubscriptions_GetFullUrl.json -func ExampleDomainEventSubscriptionsClient_GetFullURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainEventSubscriptionsClient().GetFullURL(ctx, "examplerg", "exampleDomain1", "examplesubscription1", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainEventSubscriptions_List.json -func ExampleDomainEventSubscriptionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDomainEventSubscriptionsClient().NewListPager("examplerg", "exampleDomain1", &armeventgrid.DomainEventSubscriptionsClientListOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domains_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/domains_client.go index 270e90e9473c..048e633989c2 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domains_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domains_client.go @@ -45,7 +45,7 @@ func NewDomainsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Asynchronously creates or updates a new domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainInfo - Domain information. @@ -71,7 +71,7 @@ func (client *DomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Asynchronously creates or updates a new domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domainInfo Domain, options *DomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DomainsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, domainInfo); err != nil { @@ -125,7 +125,7 @@ func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Delete existing domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - options - DomainsClientBeginDeleteOptions contains the optional parameters for the DomainsClient.BeginDelete method. @@ -149,7 +149,7 @@ func (client *DomainsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete existing domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DomainsClient.BeginDelete" @@ -191,7 +191,7 @@ func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -199,7 +199,7 @@ func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Get properties of a domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - options - DomainsClientGetOptions contains the optional parameters for the DomainsClient.Get method. @@ -245,7 +245,7 @@ func (client *DomainsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *DomainsClient) getHandleResponse(resp *http.Response) (DomainsClie // NewListByResourceGroupPager - List all the domains under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - DomainsClientListByResourceGroupOptions contains the optional parameters for the DomainsClient.NewListByResourceGroupPager // method. @@ -311,7 +311,7 @@ func (client *DomainsClient) listByResourceGroupCreateRequest(ctx context.Contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *DomainsClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListBySubscriptionPager - List all the domains under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - DomainsClientListBySubscriptionOptions contains the optional parameters for the DomainsClient.NewListBySubscriptionPager // method. func (client *DomainsClient) NewListBySubscriptionPager(options *DomainsClientListBySubscriptionOptions) *runtime.Pager[DomainsClientListBySubscriptionResponse] { @@ -372,7 +372,7 @@ func (client *DomainsClient) listBySubscriptionCreateRequest(ctx context.Context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +390,7 @@ func (client *DomainsClient) listBySubscriptionHandleResponse(resp *http.Respons // ListSharedAccessKeys - List the two keys used to publish to a domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - options - DomainsClientListSharedAccessKeysOptions contains the optional parameters for the DomainsClient.ListSharedAccessKeys @@ -437,7 +437,7 @@ func (client *DomainsClient) listSharedAccessKeysCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -455,7 +455,7 @@ func (client *DomainsClient) listSharedAccessKeysHandleResponse(resp *http.Respo // RegenerateKey - Regenerate a shared access key for a domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - regenerateKeyRequest - Request body to regenerate key. @@ -502,7 +502,7 @@ func (client *DomainsClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateKeyRequest); err != nil { @@ -523,7 +523,7 @@ func (client *DomainsClient) regenerateKeyHandleResponse(resp *http.Response) (D // BeginUpdate - Asynchronously updates a domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainUpdateParameters - Domain update information. @@ -548,7 +548,7 @@ func (client *DomainsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Asynchronously updates a domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainsClient) update(ctx context.Context, resourceGroupName string, domainName string, domainUpdateParameters DomainUpdateParameters, options *DomainsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DomainsClient.BeginUpdate" @@ -590,7 +590,7 @@ func (client *DomainsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, domainUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domains_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/domains_client_example_test.go deleted file mode 100644 index 8ddfaafcfe5b..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domains_client_example_test.go +++ /dev/null @@ -1,317 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Get.json -func ExampleDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainsClient().Get(ctx, "examplerg", "exampledomain2", 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.Domain = armeventgrid.Domain{ - // Name: to.Ptr("exampledomain2"), - // Type: to.Ptr("Microsoft.EventGrid/domains"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain2"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.DomainProperties{ - // Endpoint: to.Ptr("https://exampledomain2.westcentralus-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.DomainProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_CreateOrUpdate.json -func ExampleDomainsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampledomain1", armeventgrid.Domain{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armeventgrid.DomainProperties{ - InboundIPRules: []*armeventgrid.InboundIPRule{ - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.30.15"), - }, - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.176.1"), - }}, - PublicNetworkAccess: to.Ptr(armeventgrid.PublicNetworkAccessEnabled), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Delete.json -func ExampleDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainsClient().BeginDelete(ctx, "examplerg", "exampledomain1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Update.json -func ExampleDomainsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainsClient().BeginUpdate(ctx, "examplerg", "exampledomain1", armeventgrid.DomainUpdateParameters{ - Properties: &armeventgrid.DomainUpdateParameterProperties{ - InboundIPRules: []*armeventgrid.InboundIPRule{ - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.30.15"), - }, - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.176.1"), - }}, - PublicNetworkAccess: to.Ptr(armeventgrid.PublicNetworkAccessEnabled), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_ListBySubscription.json -func ExampleDomainsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDomainsClient().NewListBySubscriptionPager(&armeventgrid.DomainsClientListBySubscriptionOptions{Filter: nil, - Top: 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.DomainsListResult = armeventgrid.DomainsListResult{ - // Value: []*armeventgrid.Domain{ - // { - // Name: to.Ptr("exampledomain1"), - // Type: to.Ptr("Microsoft.EventGrid/domains"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain1"), - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.DomainProperties{ - // Endpoint: to.Ptr("https://exampledomain1.westus2-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.DomainProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("exampledomain2"), - // Type: to.Ptr("Microsoft.EventGrid/domains"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain2"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.DomainProperties{ - // Endpoint: to.Ptr("https://exampledomain2.westcentralus-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.DomainProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_ListByResourceGroup.json -func ExampleDomainsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDomainsClient().NewListByResourceGroupPager("examplerg", &armeventgrid.DomainsClientListByResourceGroupOptions{Filter: nil, - Top: 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.DomainsListResult = armeventgrid.DomainsListResult{ - // Value: []*armeventgrid.Domain{ - // { - // Name: to.Ptr("exampledomain1"), - // Type: to.Ptr("Microsoft.EventGrid/domains"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain1"), - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.DomainProperties{ - // Endpoint: to.Ptr("https://exampledomain1.westus2-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.DomainProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("exampledomain2"), - // Type: to.Ptr("Microsoft.EventGrid/domains"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain2"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.DomainProperties{ - // Endpoint: to.Ptr("https://exampledomain2.westcentralus-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.DomainProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_ListSharedAccessKeys.json -func ExampleDomainsClient_ListSharedAccessKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainsClient().ListSharedAccessKeys(ctx, "examplerg", "exampledomain2", 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.DomainSharedAccessKeys = armeventgrid.DomainSharedAccessKeys{ - // Key1: to.Ptr(""), - // Key2: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_RegenerateKey.json -func ExampleDomainsClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainsClient().RegenerateKey(ctx, "examplerg", "exampledomain2", armeventgrid.DomainRegenerateKeyRequest{ - KeyName: to.Ptr("key1"), - }, 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.DomainSharedAccessKeys = armeventgrid.DomainSharedAccessKeys{ - // Key1: to.Ptr(""), - // Key2: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client.go index 3bf44959c70b..530cae42c6f3 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client.go @@ -45,7 +45,7 @@ func NewDomainTopicEventSubscriptionsClient(subscriptionID string, credential az // BeginCreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the top level domain. // - topicName - Name of the domain topic. @@ -74,7 +74,7 @@ func (client *DomainTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DomainTopicEventSubscriptionsClient.BeginCreateOrUpdate" @@ -124,7 +124,7 @@ func (client *DomainTopicEventSubscriptionsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionInfo); err != nil { @@ -136,7 +136,7 @@ func (client *DomainTopicEventSubscriptionsClient) createOrUpdateCreateRequest(c // BeginDelete - Delete a nested existing event subscription for a domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the top level domain. // - topicName - Name of the domain topic. @@ -163,7 +163,7 @@ func (client *DomainTopicEventSubscriptionsClient) BeginDelete(ctx context.Conte // Delete - Delete a nested existing event subscription for a domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DomainTopicEventSubscriptionsClient.BeginDelete" @@ -213,7 +213,7 @@ func (client *DomainTopicEventSubscriptionsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -221,7 +221,7 @@ func (client *DomainTopicEventSubscriptionsClient) deleteCreateRequest(ctx conte // Get - Get properties of a nested event subscription for a domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the top level domain. // - topicName - Name of the domain topic. @@ -278,7 +278,7 @@ func (client *DomainTopicEventSubscriptionsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,7 +296,7 @@ func (client *DomainTopicEventSubscriptionsClient) getHandleResponse(resp *http. // GetDeliveryAttributes - Get all delivery attributes for an event subscription for domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the top level domain. // - topicName - Name of the domain topic. @@ -353,7 +353,7 @@ func (client *DomainTopicEventSubscriptionsClient) getDeliveryAttributesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +371,7 @@ func (client *DomainTopicEventSubscriptionsClient) getDeliveryAttributesHandleRe // GetFullURL - Get the full endpoint URL for a nested event subscription for domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the top level domain. // - topicName - Name of the domain topic. @@ -428,7 +428,7 @@ func (client *DomainTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -445,7 +445,7 @@ func (client *DomainTopicEventSubscriptionsClient) getFullURLHandleResponse(resp // NewListPager - List all event subscriptions that have been created for a specific domain topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the top level domain. // - topicName - Name of the domain topic. @@ -504,7 +504,7 @@ func (client *DomainTopicEventSubscriptionsClient) listCreateRequest(ctx context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -522,7 +522,7 @@ func (client *DomainTopicEventSubscriptionsClient) listHandleResponse(resp *http // BeginUpdate - Update an existing event subscription for a domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - topicName - Name of the topic. @@ -550,7 +550,7 @@ func (client *DomainTopicEventSubscriptionsClient) BeginUpdate(ctx context.Conte // Update - Update an existing event subscription for a domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DomainTopicEventSubscriptionsClient.BeginUpdate" @@ -600,7 +600,7 @@ func (client *DomainTopicEventSubscriptionsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client_example_test.go deleted file mode 100644 index 23a228a8ee14..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client_example_test.go +++ /dev/null @@ -1,322 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_Get.json -func ExampleDomainTopicEventSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainTopicEventSubscriptionsClient().Get(ctx, "examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/domainTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/domainTopics/exampleDomainTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/domainTopics/exampleDomainTopic1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_CreateOrUpdate.json -func ExampleDomainTopicEventSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainTopicEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleDomain1", "exampleDomainTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("exampleEventSubscriptionName1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/domainTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/domainTopics/exampleDomainTopic1/eventSubscriptions/exampleEventSubscriptionName1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/domainTopics/exampleDomainTopic1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_Delete.json -func ExampleDomainTopicEventSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainTopicEventSubscriptionsClient().BeginDelete(ctx, "examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_Update.json -func ExampleDomainTopicEventSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainTopicEventSubscriptionsClient().BeginUpdate(ctx, "examplerg", "exampleDomain1", "exampleDomainTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_GetFullUrl.json -func ExampleDomainTopicEventSubscriptionsClient_GetFullURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainTopicEventSubscriptionsClient().GetFullURL(ctx, "examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_List.json -func ExampleDomainTopicEventSubscriptionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDomainTopicEventSubscriptionsClient().NewListPager("examplerg", "exampleDomain1", "exampleDomainTopic1", &armeventgrid.DomainTopicEventSubscriptionsClientListOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/domainTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/domainTopics/exampleDomainTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampleDomain1/domainTopics/exampleDomainTopic1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopicEventSubscriptions_GetDeliveryAttributes.json -func ExampleDomainTopicEventSubscriptionsClient_GetDeliveryAttributes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainTopicEventSubscriptionsClient().GetDeliveryAttributes(ctx, "examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", 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.DeliveryAttributeListResult = armeventgrid.DeliveryAttributeListResult{ - // Value: []armeventgrid.DeliveryAttributeMappingClassification{ - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header1"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(false), - // Value: to.Ptr("NormalValue"), - // }, - // }, - // &armeventgrid.DynamicDeliveryAttributeMapping{ - // Name: to.Ptr("header2"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeDynamic), - // Properties: &armeventgrid.DynamicDeliveryAttributeMappingProperties{ - // SourceField: to.Ptr("data.foo"), - // }, - // }, - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header3"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(true), - // Value: to.Ptr("mySecretValue"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client.go index f8675fe3aed8..853b65318271 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client.go @@ -45,7 +45,7 @@ func NewDomainTopicsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Asynchronously creates or updates a new domain topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainTopicName - Name of the domain topic. @@ -71,7 +71,7 @@ func (client *DomainTopicsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Asynchronously creates or updates a new domain topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domainTopicName string, options *DomainTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DomainTopicsClient.BeginCreateOrUpdate" @@ -117,7 +117,7 @@ func (client *DomainTopicsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *DomainTopicsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete existing domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainTopicName - Name of the domain topic. @@ -152,7 +152,7 @@ func (client *DomainTopicsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete existing domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *DomainTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, domainTopicName string, options *DomainTopicsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DomainTopicsClient.BeginDelete" @@ -198,7 +198,7 @@ func (client *DomainTopicsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -206,7 +206,7 @@ func (client *DomainTopicsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get properties of a domain topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainTopicName - Name of the topic. @@ -257,7 +257,7 @@ func (client *DomainTopicsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,7 +274,7 @@ func (client *DomainTopicsClient) getHandleResponse(resp *http.Response) (Domain // NewListByDomainPager - List all the topics in a domain. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Domain name. // - options - DomainTopicsClientListByDomainOptions contains the optional parameters for the DomainTopicsClient.NewListByDomainPager @@ -328,7 +328,7 @@ func (client *DomainTopicsClient) listByDomainCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client_example_test.go deleted file mode 100644 index 01e321b39506..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client_example_test.go +++ /dev/null @@ -1,134 +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 armeventgrid_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_Get.json -func ExampleDomainTopicsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDomainTopicsClient().Get(ctx, "examplerg", "exampledomain2", "topic1", 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.DomainTopic = armeventgrid.DomainTopic{ - // Name: to.Ptr("topic1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain2/topics/topic1"), - // Properties: &armeventgrid.DomainTopicProperties{ - // ProvisioningState: to.Ptr(armeventgrid.DomainTopicProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_CreateOrUpdate.json -func ExampleDomainTopicsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainTopicsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampledomain1", "exampledomaintopic1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_Delete.json -func ExampleDomainTopicsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDomainTopicsClient().BeginDelete(ctx, "examplerg", "exampledomain1", "exampledomaintopic1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_ListByDomain.json -func ExampleDomainTopicsClient_NewListByDomainPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDomainTopicsClient().NewListByDomainPager("examplerg", "exampledomain2", &armeventgrid.DomainTopicsClientListByDomainOptions{Filter: nil, - Top: 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.DomainTopicsListResult = armeventgrid.DomainTopicsListResult{ - // Value: []*armeventgrid.DomainTopic{ - // { - // Name: to.Ptr("domainCli100topic1"), - // Type: to.Ptr("Microsoft.EventGrid/domains/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/devexprg/providers/Microsoft.EventGrid/domains/domainCli100/topics/domainCli100topic1"), - // Properties: &armeventgrid.DomainTopicProperties{ - // ProvisioningState: to.Ptr(armeventgrid.DomainTopicProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("domainCli100topic2"), - // Type: to.Ptr("Microsoft.EventGrid/domains/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/devexprg/providers/Microsoft.EventGrid/domains/domainCli100/topics/domainCli100topic2"), - // Properties: &armeventgrid.DomainTopicProperties{ - // ProvisioningState: to.Ptr(armeventgrid.DomainTopicProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client.go index d1b8f4d4bab7..dc5d37f1b4bb 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client.go @@ -46,7 +46,7 @@ func NewEventSubscriptionsClient(subscriptionID string, credential azcore.TokenC // the specified scope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - scope - The identifier of the resource to which the event subscription needs to be created or updated. The scope can be // a subscription, or a resource group, or a top level resource belonging to a resource // provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -81,7 +81,7 @@ func (client *EventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, // specified scope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *EventSubscriptionsClient) createOrUpdate(ctx context.Context, scope string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *EventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "EventSubscriptionsClient.BeginCreateOrUpdate" @@ -116,7 +116,7 @@ func (client *EventSubscriptionsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionInfo); err != nil { @@ -128,7 +128,7 @@ func (client *EventSubscriptionsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Delete an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -160,7 +160,7 @@ func (client *EventSubscriptionsClient) BeginDelete(ctx context.Context, scope s // Delete - Delete an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *EventSubscriptionsClient) deleteOperation(ctx context.Context, scope string, eventSubscriptionName string, options *EventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "EventSubscriptionsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *EventSubscriptionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -203,7 +203,7 @@ func (client *EventSubscriptionsClient) deleteCreateRequest(ctx context.Context, // Get - Get properties of an event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -249,7 +249,7 @@ func (client *EventSubscriptionsClient) getCreateRequest(ctx context.Context, sc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *EventSubscriptionsClient) getHandleResponse(resp *http.Response) ( // GetDeliveryAttributes - Get all delivery attributes for an event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -314,7 +314,7 @@ func (client *EventSubscriptionsClient) getDeliveryAttributesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,7 @@ func (client *EventSubscriptionsClient) getDeliveryAttributesHandleResponse(resp // GetFullURL - Get the full endpoint URL for an event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -379,7 +379,7 @@ func (client *EventSubscriptionsClient) getFullURLCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -396,7 +396,7 @@ func (client *EventSubscriptionsClient) getFullURLHandleResponse(resp *http.Resp // NewListByDomainTopicPager - List all event subscriptions that have been created for a specific domain topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the top level domain. // - topicName - Name of the domain topic. @@ -455,7 +455,7 @@ func (client *EventSubscriptionsClient) listByDomainTopicCreateRequest(ctx conte if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -472,7 +472,7 @@ func (client *EventSubscriptionsClient) listByDomainTopicHandleResponse(resp *ht // NewListByResourcePager - List all event subscriptions that have been created for a specific resource. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - providerNamespace - Namespace of the provider of the topic. // - resourceTypeName - Name of the resource type. @@ -536,7 +536,7 @@ func (client *EventSubscriptionsClient) listByResourceCreateRequest(ctx context. if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -554,7 +554,7 @@ func (client *EventSubscriptionsClient) listByResourceHandleResponse(resp *http. // NewListGlobalByResourceGroupPager - List all global event subscriptions under a specific Azure subscription and resource // group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - EventSubscriptionsClientListGlobalByResourceGroupOptions contains the optional parameters for the EventSubscriptionsClient.NewListGlobalByResourceGroupPager // method. @@ -603,7 +603,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupCreateRequest(c if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -621,7 +621,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupHandleResponse( // NewListGlobalByResourceGroupForTopicTypePager - List all global event subscriptions under a resource group for a specific // topic type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicTypeName - Name of the topic type. // - options - EventSubscriptionsClientListGlobalByResourceGroupForTopicTypeOptions contains the optional parameters for the @@ -675,7 +675,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupForTopicTypeCre if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -692,7 +692,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupForTopicTypeHan // NewListGlobalBySubscriptionPager - List all aggregated global event subscriptions under a specific Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - EventSubscriptionsClientListGlobalBySubscriptionOptions contains the optional parameters for the EventSubscriptionsClient.NewListGlobalBySubscriptionPager // method. func (client *EventSubscriptionsClient) NewListGlobalBySubscriptionPager(options *EventSubscriptionsClientListGlobalBySubscriptionOptions) *runtime.Pager[EventSubscriptionsClientListGlobalBySubscriptionResponse] { @@ -736,7 +736,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionCreateRequest(ct if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -754,7 +754,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionHandleResponse(r // NewListGlobalBySubscriptionForTopicTypePager - List all global event subscriptions under an Azure subscription for a topic // type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - topicTypeName - Name of the topic type. // - options - EventSubscriptionsClientListGlobalBySubscriptionForTopicTypeOptions contains the optional parameters for the // EventSubscriptionsClient.NewListGlobalBySubscriptionForTopicTypePager method. @@ -803,7 +803,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionForTopicTypeCrea if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -821,7 +821,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionForTopicTypeHand // NewListRegionalByResourceGroupPager - List all event subscriptions from the given location under a specific Azure subscription // and resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - location - Name of the location. // - options - EventSubscriptionsClientListRegionalByResourceGroupOptions contains the optional parameters for the EventSubscriptionsClient.NewListRegionalByResourceGroupPager @@ -875,7 +875,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupCreateRequest if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -893,7 +893,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupHandleRespons // NewListRegionalByResourceGroupForTopicTypePager - List all event subscriptions from the given location under a specific // Azure subscription and resource group and topic type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - location - Name of the location. // - topicTypeName - Name of the topic type. @@ -952,7 +952,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupForTopicTypeC if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -969,7 +969,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupForTopicTypeH // NewListRegionalBySubscriptionPager - List all event subscriptions from the given location under a specific Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - location - Name of the location. // - options - EventSubscriptionsClientListRegionalBySubscriptionOptions contains the optional parameters for the EventSubscriptionsClient.NewListRegionalBySubscriptionPager // method. @@ -1018,7 +1018,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionCreateRequest( if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1036,7 +1036,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionHandleResponse // NewListRegionalBySubscriptionForTopicTypePager - List all event subscriptions from the given location under a specific // Azure subscription and topic type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - location - Name of the location. // - topicTypeName - Name of the topic type. // - options - EventSubscriptionsClientListRegionalBySubscriptionForTopicTypeOptions contains the optional parameters for the @@ -1090,7 +1090,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionForTopicTypeCr if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1108,7 +1108,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionForTopicTypeHa // BeginUpdate - Asynchronously updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - scope - The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level // resource belonging to a resource provider namespace, or an EventGrid topic. For example, // use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -1141,7 +1141,7 @@ func (client *EventSubscriptionsClient) BeginUpdate(ctx context.Context, scope s // Update - Asynchronously updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *EventSubscriptionsClient) update(ctx context.Context, scope string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *EventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "EventSubscriptionsClient.BeginUpdate" @@ -1176,7 +1176,7 @@ func (client *EventSubscriptionsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client_example_test.go deleted file mode 100644 index e6e65d192b8a..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client_example_test.go +++ /dev/null @@ -1,2275 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopic() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic_AzureFunctionDestination.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicAzureFunctionDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.AzureFunctionEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeAzureFunction), - // Properties: &armeventgrid.AzureFunctionEventSubscriptionDestinationProperties{ - // ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic_EventHubDestination.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicEventHubDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.EventHubEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), - // Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ - // ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic_HybridConnectionDestination.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicHybridConnectionDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.HybridConnectionEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeHybridConnection), - // Properties: &armeventgrid.HybridConnectionEventSubscriptionDestinationProperties{ - // ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicServiceBusQueueDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.ServiceBusQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusQueue), - // Properties: &armeventgrid.ServiceBusQueueEventSubscriptionDestinationProperties{ - // ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicServiceBusTopicDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.ServiceBusTopicEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusTopic), - // Properties: &armeventgrid.ServiceBusTopicEventSubscriptionDestinationProperties{ - // ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic_StorageQueueDestination.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicStorageQueueDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueMessageTimeToLiveInSeconds: to.Ptr[int64](300), - // QueueName: to.Ptr("queue1"), - // ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForCustomTopic_WebhookDestination.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForCustomTopicWebhookDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForResource.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.EventHubEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), - // Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ - // ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForResourceGroup.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", "examplesubscription2", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription2"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetForSubscription.json -func ExampleEventSubscriptionsClient_Get_eventSubscriptionsGetForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription3"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopic() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.EventHubEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), - Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_AzureFunctionDestination.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopicAzureFunctionDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.AzureFunctionEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeAzureFunction), - Properties: &armeventgrid.AzureFunctionEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_EventHubDestination.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopicEventHubDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.EventHubEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), - Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_HybridConnectionDestination.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopicHybridConnectionDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.HybridConnectionEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeHybridConnection), - Properties: &armeventgrid.HybridConnectionEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusQueueDestination.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopicServiceBusQueueDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.ServiceBusQueueEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusQueue), - Properties: &armeventgrid.ServiceBusQueueEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusTopicDestination.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopicServiceBusTopicDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.ServiceBusTopicEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusTopic), - Properties: &armeventgrid.ServiceBusTopicEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_StorageQueueDestination.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopicStorageQueueDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - QueueName: to.Ptr("queue1"), - ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_WebhookDestination.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForCustomTopicWebhookDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://azurefunctionexample.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=PASSWORDCODE"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForResource.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", "examplesubscription10", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForResourceGroup.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", "examplesubscription2", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_CreateOrUpdateForSubscription.json -func ExampleEventSubscriptionsClient_BeginCreateOrUpdate_eventSubscriptionsCreateOrUpdateForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_DeleteForCustomTopic.json -func ExampleEventSubscriptionsClient_BeginDelete_eventSubscriptionsDeleteForCustomTopic() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginDelete(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_DeleteForResource.json -func ExampleEventSubscriptionsClient_BeginDelete_eventSubscriptionsDeleteForResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginDelete(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", "examplesubscription10", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_DeleteForResourceGroup.json -func ExampleEventSubscriptionsClient_BeginDelete_eventSubscriptionsDeleteForResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginDelete(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", "examplesubscription2", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_DeleteForSubscription.json -func ExampleEventSubscriptionsClient_BeginDelete_eventSubscriptionsDeleteForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginDelete(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopic() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicAzureFunctionDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.AzureFunctionEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeAzureFunction), - Properties: &armeventgrid.AzureFunctionEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicEventHubDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.EventHubEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), - Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicHybridConnectionDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.HybridConnectionEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeHybridConnection), - Properties: &armeventgrid.HybridConnectionEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicServiceBusQueueDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.ServiceBusQueueEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusQueue), - Properties: &armeventgrid.ServiceBusQueueEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicServiceBusTopicDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.ServiceBusTopicEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeServiceBusTopic), - Properties: &armeventgrid.ServiceBusTopicEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicStorageQueueDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - QueueMessageTimeToLiveInSeconds: to.Ptr[int64](300), - QueueName: to.Ptr("queue1"), - ResourceID: to.Ptr("/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForCustomTopicWebhookDestination() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForResource.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", "examplesubscription1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForResourceGroup.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", "examplesubscription2", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.EventHubEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), - Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_UpdateForSubscription.json -func ExampleEventSubscriptionsClient_BeginUpdate_eventSubscriptionsUpdateForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEventSubscriptionsClient().BeginUpdate(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetFullUrlForCustomTopic.json -func ExampleEventSubscriptionsClient_GetFullURL_eventSubscriptionsGetFullUrlForCustomTopic() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().GetFullURL(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", "examplesubscription1", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetFullUrlForResource.json -func ExampleEventSubscriptionsClient_GetFullURL_eventSubscriptionsGetFullUrlForResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().GetFullURL(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", "examplesubscription1", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetFullUrlForResourceGroup.json -func ExampleEventSubscriptionsClient_GetFullURL_eventSubscriptionsGetFullUrlForResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().GetFullURL(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", "examplesubscription2", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetFullUrlForSubscription.json -func ExampleEventSubscriptionsClient_GetFullURL_eventSubscriptionsGetFullUrlForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().GetFullURL(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListGlobalBySubscription.json -func ExampleEventSubscriptionsClient_NewListGlobalBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListGlobalBySubscriptionPager(&armeventgrid.EventSubscriptionsClientListGlobalBySubscriptionOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription2"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription4"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription4"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListGlobalBySubscriptionForTopicType.json -func ExampleEventSubscriptionsClient_NewListGlobalBySubscriptionForTopicTypePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListGlobalBySubscriptionForTopicTypePager("Microsoft.Resources.Subscriptions", &armeventgrid.EventSubscriptionsClientListGlobalBySubscriptionForTopicTypeOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription3"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListGlobalByResourceGroup.json -func ExampleEventSubscriptionsClient_NewListGlobalByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListGlobalByResourceGroupPager("examplerg", &armeventgrid.EventSubscriptionsClientListGlobalByResourceGroupOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription2"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription4"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription4"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListGlobalByResourceGroupForTopicType.json -func ExampleEventSubscriptionsClient_NewListGlobalByResourceGroupForTopicTypePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListGlobalByResourceGroupForTopicTypePager("examplerg", "Microsoft.Resources.ResourceGroups", &armeventgrid.EventSubscriptionsClientListGlobalByResourceGroupForTopicTypeOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription3"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListRegionalBySubscription.json -func ExampleEventSubscriptionsClient_NewListRegionalBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListRegionalBySubscriptionPager("westus2", &armeventgrid.EventSubscriptionsClientListRegionalBySubscriptionOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription10"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription10"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.EventHubEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), - // Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ - // ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription11"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription11"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListRegionalByResourceGroup.json -func ExampleEventSubscriptionsClient_NewListRegionalByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListRegionalByResourceGroupPager("examplerg", "westus2", &armeventgrid.EventSubscriptionsClientListRegionalByResourceGroupOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription10"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription10"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription11"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription11"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListRegionalBySubscriptionForTopicType.json -func ExampleEventSubscriptionsClient_NewListRegionalBySubscriptionForTopicTypePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListRegionalBySubscriptionForTopicTypePager("westus2", "Microsoft.EventHub.namespaces", &armeventgrid.EventSubscriptionsClientListRegionalBySubscriptionForTopicTypeOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription10"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription10"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription11"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription11"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListRegionalByResourceGroupForTopicType.json -func ExampleEventSubscriptionsClient_NewListRegionalByResourceGroupForTopicTypePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListRegionalByResourceGroupForTopicTypePager("examplerg", "westus2", "Microsoft.EventHub.namespaces", &armeventgrid.EventSubscriptionsClientListRegionalByResourceGroupForTopicTypeOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription10"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription10"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription11"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription11"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("Finance"), - // to.Ptr("HR")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventhub/namespaces/examplenamespace1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListByResource.json -func ExampleEventSubscriptionsClient_NewListByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListByResourcePager("examplerg", "Microsoft.EventGrid", "topics", "exampletopic2", &armeventgrid.EventSubscriptionsClientListByResourceOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription2"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription3"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // Labels: []*string{ - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_ListByDomainTopic.json -func ExampleEventSubscriptionsClient_NewListByDomainTopicPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEventSubscriptionsClient().NewListByDomainTopicPager("examplerg", "domain1", "topic1", &armeventgrid.EventSubscriptionsClientListByDomainTopicOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/domain1/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/domains/domain1/topics/topic1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription2"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/domain1/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription2"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/domains/domain1/topics/topic1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription3"), - // Type: to.Ptr("Microsoft.EventGrid/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/domain1/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription3"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // Labels: []*string{ - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/domains/domain1/topics/topic1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/EventSubscriptions_GetDeliveryAttributes.json -func ExampleEventSubscriptionsClient_GetDeliveryAttributes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEventSubscriptionsClient().GetDeliveryAttributes(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", 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.DeliveryAttributeListResult = armeventgrid.DeliveryAttributeListResult{ - // Value: []armeventgrid.DeliveryAttributeMappingClassification{ - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header1"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // }, - // &armeventgrid.DynamicDeliveryAttributeMapping{ - // Name: to.Ptr("header2"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeDynamic), - // }, - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header3"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // }}, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client.go index 5e5fd3306da1..eb9e9626eb85 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client.go @@ -40,7 +40,7 @@ func NewExtensionTopicsClient(credential azcore.TokenCredential, options *arm.Cl // Get - Get the properties of an extension topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - scope - The identifier of the resource to which extension topic is queried. The scope can be a subscription, or a resource // group, or a top level resource belonging to a resource provider namespace. For // example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -82,7 +82,7 @@ func (client *ExtensionTopicsClient) getCreateRequest(ctx context.Context, scope return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client_example_test.go deleted file mode 100644 index 1254e1aacf97..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client_example_test.go +++ /dev/null @@ -1,47 +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 armeventgrid_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ExtensionTopics_Get.json -func ExampleExtensionTopicsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionTopicsClient().Get(ctx, "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.storage/storageaccounts/exampleResourceName/providers/Microsoft.eventgrid/extensionTopics/default", 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.ExtensionTopic = armeventgrid.ExtensionTopic{ - // Name: to.Ptr("default"), - // Type: to.Ptr("providers/Microsoft.EventGrid/extensionTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.storage/storageaccounts/exampleResourceName/providers/Microsoft.eventgrid/extensionTopics/default"), - // Properties: &armeventgrid.ExtensionTopicProperties{ - // Description: to.Ptr("Extension topic for /subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.storage/storageaccounts/exampleResourceName/providers/Microsoft.eventgrid/extensionTopics/default that can be used to obtain metrics"), - // SystemTopic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleResourceName-2a41650f-00dd-4790-b3ab-dabd12d227cb"), - // }, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/fake/networksecurityperimeterconfigurations_server.go b/sdk/resourcemanager/eventgrid/armeventgrid/fake/networksecurityperimeterconfigurations_server.go new file mode 100644 index 000000000000..6afcd2118f9f --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/fake/networksecurityperimeterconfigurations_server.go @@ -0,0 +1,268 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" + "net/http" + "net/url" + "regexp" +) + +// NetworkSecurityPerimeterConfigurationsServer is a fake server for instances of the armeventgrid.NetworkSecurityPerimeterConfigurationsClient type. +type NetworkSecurityPerimeterConfigurationsServer struct { + // Get is the fake for method NetworkSecurityPerimeterConfigurationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceType armeventgrid.NetworkSecurityPerimeterResourceType, resourceName string, perimeterGUID string, associationName string, options *armeventgrid.NetworkSecurityPerimeterConfigurationsClientGetOptions) (resp azfake.Responder[armeventgrid.NetworkSecurityPerimeterConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method NetworkSecurityPerimeterConfigurationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, resourceType armeventgrid.NetworkSecurityPerimeterResourceType, resourceName string, options *armeventgrid.NetworkSecurityPerimeterConfigurationsClientListOptions) (resp azfake.PagerResponder[armeventgrid.NetworkSecurityPerimeterConfigurationsClientListResponse]) + + // BeginReconcile is the fake for method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginReconcile func(ctx context.Context, resourceGroupName string, resourceType armeventgrid.NetworkSecurityPerimeterResourceType, resourceName string, perimeterGUID string, associationName string, options *armeventgrid.NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (resp azfake.PollerResponder[armeventgrid.NetworkSecurityPerimeterConfigurationsClientReconcileResponse], errResp azfake.ErrorResponder) +} + +// NewNetworkSecurityPerimeterConfigurationsServerTransport creates a new instance of NetworkSecurityPerimeterConfigurationsServerTransport with the provided implementation. +// The returned NetworkSecurityPerimeterConfigurationsServerTransport instance is connected to an instance of armeventgrid.NetworkSecurityPerimeterConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNetworkSecurityPerimeterConfigurationsServerTransport(srv *NetworkSecurityPerimeterConfigurationsServer) *NetworkSecurityPerimeterConfigurationsServerTransport { + return &NetworkSecurityPerimeterConfigurationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armeventgrid.NetworkSecurityPerimeterConfigurationsClientListResponse]](), + beginReconcile: newTracker[azfake.PollerResponder[armeventgrid.NetworkSecurityPerimeterConfigurationsClientReconcileResponse]](), + } +} + +// NetworkSecurityPerimeterConfigurationsServerTransport connects instances of armeventgrid.NetworkSecurityPerimeterConfigurationsClient to instances of NetworkSecurityPerimeterConfigurationsServer. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsServerTransport instead. +type NetworkSecurityPerimeterConfigurationsServerTransport struct { + srv *NetworkSecurityPerimeterConfigurationsServer + newListPager *tracker[azfake.PagerResponder[armeventgrid.NetworkSecurityPerimeterConfigurationsClientListResponse]] + beginReconcile *tracker[azfake.PollerResponder[armeventgrid.NetworkSecurityPerimeterConfigurationsClientReconcileResponse]] +} + +// Do implements the policy.Transporter interface for NetworkSecurityPerimeterConfigurationsServerTransport. +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return n.dispatchToMethodFake(req, method) +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if networkSecurityPerimeterConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = networkSecurityPerimeterConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NetworkSecurityPerimeterConfigurationsClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NetworkSecurityPerimeterConfigurationsClient.NewListPager": + res.resp, res.err = n.dispatchNewListPager(req) + case "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile": + res.resp, res.err = n.dispatchBeginReconcile(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if n.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)\.(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceTypeParam, err := parseWithCast(matches[regex.SubexpIndex("resourceType")], func(v string) (armeventgrid.NetworkSecurityPerimeterResourceType, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armeventgrid.NetworkSecurityPerimeterResourceType(p), nil + }) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + perimeterGUIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("perimeterGuid")]) + if err != nil { + return nil, err + } + associationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("associationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Get(req.Context(), resourceGroupNameParam, resourceTypeParam, resourceNameParam, perimeterGUIDParam, associationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkSecurityPerimeterConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if n.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := n.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceTypeParam, err := parseWithCast(matches[regex.SubexpIndex("resourceType")], func(v string) (armeventgrid.NetworkSecurityPerimeterResourceType, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armeventgrid.NetworkSecurityPerimeterResourceType(p), nil + }) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + resp := n.srv.NewListPager(resourceGroupNameParam, resourceTypeParam, resourceNameParam, nil) + newListPager = &resp + n.newListPager.add(req, newListPager) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + n.newListPager.remove(req) + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchBeginReconcile(req *http.Request) (*http.Response, error) { + if n.srv.BeginReconcile == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginReconcile not implemented")} + } + beginReconcile := n.beginReconcile.get(req) + if beginReconcile == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)\.(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceTypeParam, err := parseWithCast(matches[regex.SubexpIndex("resourceType")], func(v string) (armeventgrid.NetworkSecurityPerimeterResourceType, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armeventgrid.NetworkSecurityPerimeterResourceType(p), nil + }) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + perimeterGUIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("perimeterGuid")]) + if err != nil { + return nil, err + } + associationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("associationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginReconcile(req.Context(), resourceGroupNameParam, resourceTypeParam, resourceNameParam, perimeterGUIDParam, associationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginReconcile = &respr + n.beginReconcile.add(req, beginReconcile) + } + + resp, err := server.PollerResponderNext(beginReconcile, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + n.beginReconcile.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginReconcile) { + n.beginReconcile.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to NetworkSecurityPerimeterConfigurationsServerTransport +var networkSecurityPerimeterConfigurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/fake/partnerdestinations_server.go b/sdk/resourcemanager/eventgrid/armeventgrid/fake/partnerdestinations_server.go new file mode 100644 index 000000000000..e06e97f4771f --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/fake/partnerdestinations_server.go @@ -0,0 +1,469 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// PartnerDestinationsServer is a fake server for instances of the armeventgrid.PartnerDestinationsClient type. +type PartnerDestinationsServer struct { + // Activate is the fake for method PartnerDestinationsClient.Activate + // HTTP status codes to indicate success: http.StatusOK + Activate func(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *armeventgrid.PartnerDestinationsClientActivateOptions) (resp azfake.Responder[armeventgrid.PartnerDestinationsClientActivateResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method PartnerDestinationsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination armeventgrid.PartnerDestination, options *armeventgrid.PartnerDestinationsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armeventgrid.PartnerDestinationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method PartnerDestinationsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *armeventgrid.PartnerDestinationsClientBeginDeleteOptions) (resp azfake.PollerResponder[armeventgrid.PartnerDestinationsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method PartnerDestinationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *armeventgrid.PartnerDestinationsClientGetOptions) (resp azfake.Responder[armeventgrid.PartnerDestinationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method PartnerDestinationsClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armeventgrid.PartnerDestinationsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armeventgrid.PartnerDestinationsClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method PartnerDestinationsClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armeventgrid.PartnerDestinationsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armeventgrid.PartnerDestinationsClientListBySubscriptionResponse]) + + // BeginUpdate is the fake for method PartnerDestinationsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters armeventgrid.PartnerDestinationUpdateParameters, options *armeventgrid.PartnerDestinationsClientBeginUpdateOptions) (resp azfake.PollerResponder[armeventgrid.PartnerDestinationsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewPartnerDestinationsServerTransport creates a new instance of PartnerDestinationsServerTransport with the provided implementation. +// The returned PartnerDestinationsServerTransport instance is connected to an instance of armeventgrid.PartnerDestinationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPartnerDestinationsServerTransport(srv *PartnerDestinationsServer) *PartnerDestinationsServerTransport { + return &PartnerDestinationsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armeventgrid.PartnerDestinationsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armeventgrid.PartnerDestinationsClientDeleteResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armeventgrid.PartnerDestinationsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armeventgrid.PartnerDestinationsClientListBySubscriptionResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armeventgrid.PartnerDestinationsClientUpdateResponse]](), + } +} + +// PartnerDestinationsServerTransport connects instances of armeventgrid.PartnerDestinationsClient to instances of PartnerDestinationsServer. +// Don't use this type directly, use NewPartnerDestinationsServerTransport instead. +type PartnerDestinationsServerTransport struct { + srv *PartnerDestinationsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armeventgrid.PartnerDestinationsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armeventgrid.PartnerDestinationsClientDeleteResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armeventgrid.PartnerDestinationsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armeventgrid.PartnerDestinationsClientListBySubscriptionResponse]] + beginUpdate *tracker[azfake.PollerResponder[armeventgrid.PartnerDestinationsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for PartnerDestinationsServerTransport. +func (p *PartnerDestinationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return p.dispatchToMethodFake(req, method) +} + +func (p *PartnerDestinationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if partnerDestinationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = partnerDestinationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PartnerDestinationsClient.Activate": + res.resp, res.err = p.dispatchActivate(req) + case "PartnerDestinationsClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PartnerDestinationsClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PartnerDestinationsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PartnerDestinationsClient.NewListByResourceGroupPager": + res.resp, res.err = p.dispatchNewListByResourceGroupPager(req) + case "PartnerDestinationsClient.NewListBySubscriptionPager": + res.resp, res.err = p.dispatchNewListBySubscriptionPager(req) + case "PartnerDestinationsClient.BeginUpdate": + res.resp, res.err = p.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (p *PartnerDestinationsServerTransport) dispatchActivate(req *http.Request) (*http.Response, error) { + if p.srv.Activate == nil { + return nil, &nonRetriableError{errors.New("fake for method Activate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/partnerDestinations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/activate` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + partnerDestinationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("partnerDestinationName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Activate(req.Context(), resourceGroupNameParam, partnerDestinationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PartnerDestination, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PartnerDestinationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if p.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := p.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/partnerDestinations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armeventgrid.PartnerDestination](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + partnerDestinationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("partnerDestinationName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, partnerDestinationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + p.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + p.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + p.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (p *PartnerDestinationsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if p.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := p.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/partnerDestinations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + partnerDestinationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("partnerDestinationName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginDelete(req.Context(), resourceGroupNameParam, partnerDestinationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + p.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + p.beginDelete.remove(req) + } + + return resp, nil +} + +func (p *PartnerDestinationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if p.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/partnerDestinations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + partnerDestinationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("partnerDestinationName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameParam, partnerDestinationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PartnerDestination, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PartnerDestinationsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := p.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/partnerDestinations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + var options *armeventgrid.PartnerDestinationsClientListByResourceGroupOptions + if filterParam != nil || topParam != nil { + options = &armeventgrid.PartnerDestinationsClientListByResourceGroupOptions{ + Filter: filterParam, + Top: topParam, + } + } + resp := p.srv.NewListByResourceGroupPager(resourceGroupNameParam, options) + newListByResourceGroupPager = &resp + p.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armeventgrid.PartnerDestinationsClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + p.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (p *PartnerDestinationsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := p.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/partnerDestinations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + var options *armeventgrid.PartnerDestinationsClientListBySubscriptionOptions + if filterParam != nil || topParam != nil { + options = &armeventgrid.PartnerDestinationsClientListBySubscriptionOptions{ + Filter: filterParam, + Top: topParam, + } + } + resp := p.srv.NewListBySubscriptionPager(options) + newListBySubscriptionPager = &resp + p.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armeventgrid.PartnerDestinationsClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + p.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (p *PartnerDestinationsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if p.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := p.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.EventGrid/partnerDestinations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armeventgrid.PartnerDestinationUpdateParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + partnerDestinationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("partnerDestinationName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginUpdate(req.Context(), resourceGroupNameParam, partnerDestinationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + p.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + p.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + p.beginUpdate.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to PartnerDestinationsServerTransport +var partnerDestinationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/fake/server_factory.go b/sdk/resourcemanager/eventgrid/armeventgrid/fake/server_factory.go index 6e892e0c64b6..540b1f3eba4f 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/fake/server_factory.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/fake/server_factory.go @@ -55,12 +55,18 @@ type ServerFactory struct { // NamespacesServer contains the fakes for client NamespacesClient NamespacesServer NamespacesServer + // NetworkSecurityPerimeterConfigurationsServer contains the fakes for client NetworkSecurityPerimeterConfigurationsClient + NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer + // OperationsServer contains the fakes for client OperationsClient OperationsServer OperationsServer // PartnerConfigurationsServer contains the fakes for client PartnerConfigurationsClient PartnerConfigurationsServer PartnerConfigurationsServer + // PartnerDestinationsServer contains the fakes for client PartnerDestinationsClient + PartnerDestinationsServer PartnerDestinationsServer + // PartnerNamespacesServer contains the fakes for client PartnerNamespacesClient PartnerNamespacesServer PartnerNamespacesServer @@ -116,37 +122,39 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armeventgrid.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trCaCertificatesServer *CaCertificatesServerTransport - trChannelsServer *ChannelsServerTransport - trClientGroupsServer *ClientGroupsServerTransport - trClientsServer *ClientsServerTransport - trDomainEventSubscriptionsServer *DomainEventSubscriptionsServerTransport - trDomainTopicEventSubscriptionsServer *DomainTopicEventSubscriptionsServerTransport - trDomainTopicsServer *DomainTopicsServerTransport - trDomainsServer *DomainsServerTransport - trEventSubscriptionsServer *EventSubscriptionsServerTransport - trExtensionTopicsServer *ExtensionTopicsServerTransport - trNamespaceTopicEventSubscriptionsServer *NamespaceTopicEventSubscriptionsServerTransport - trNamespaceTopicsServer *NamespaceTopicsServerTransport - trNamespacesServer *NamespacesServerTransport - trOperationsServer *OperationsServerTransport - trPartnerConfigurationsServer *PartnerConfigurationsServerTransport - trPartnerNamespacesServer *PartnerNamespacesServerTransport - trPartnerRegistrationsServer *PartnerRegistrationsServerTransport - trPartnerTopicEventSubscriptionsServer *PartnerTopicEventSubscriptionsServerTransport - trPartnerTopicsServer *PartnerTopicsServerTransport - trPermissionBindingsServer *PermissionBindingsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trSystemTopicEventSubscriptionsServer *SystemTopicEventSubscriptionsServerTransport - trSystemTopicsServer *SystemTopicsServerTransport - trTopicEventSubscriptionsServer *TopicEventSubscriptionsServerTransport - trTopicSpacesServer *TopicSpacesServerTransport - trTopicTypesServer *TopicTypesServerTransport - trTopicsServer *TopicsServerTransport - trVerifiedPartnersServer *VerifiedPartnersServerTransport + srv *ServerFactory + trMu sync.Mutex + trCaCertificatesServer *CaCertificatesServerTransport + trChannelsServer *ChannelsServerTransport + trClientGroupsServer *ClientGroupsServerTransport + trClientsServer *ClientsServerTransport + trDomainEventSubscriptionsServer *DomainEventSubscriptionsServerTransport + trDomainTopicEventSubscriptionsServer *DomainTopicEventSubscriptionsServerTransport + trDomainTopicsServer *DomainTopicsServerTransport + trDomainsServer *DomainsServerTransport + trEventSubscriptionsServer *EventSubscriptionsServerTransport + trExtensionTopicsServer *ExtensionTopicsServerTransport + trNamespaceTopicEventSubscriptionsServer *NamespaceTopicEventSubscriptionsServerTransport + trNamespaceTopicsServer *NamespaceTopicsServerTransport + trNamespacesServer *NamespacesServerTransport + trNetworkSecurityPerimeterConfigurationsServer *NetworkSecurityPerimeterConfigurationsServerTransport + trOperationsServer *OperationsServerTransport + trPartnerConfigurationsServer *PartnerConfigurationsServerTransport + trPartnerDestinationsServer *PartnerDestinationsServerTransport + trPartnerNamespacesServer *PartnerNamespacesServerTransport + trPartnerRegistrationsServer *PartnerRegistrationsServerTransport + trPartnerTopicEventSubscriptionsServer *PartnerTopicEventSubscriptionsServerTransport + trPartnerTopicsServer *PartnerTopicsServerTransport + trPermissionBindingsServer *PermissionBindingsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trSystemTopicEventSubscriptionsServer *SystemTopicEventSubscriptionsServerTransport + trSystemTopicsServer *SystemTopicsServerTransport + trTopicEventSubscriptionsServer *TopicEventSubscriptionsServerTransport + trTopicSpacesServer *TopicSpacesServerTransport + trTopicTypesServer *TopicTypesServerTransport + trTopicsServer *TopicsServerTransport + trVerifiedPartnersServer *VerifiedPartnersServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -215,6 +223,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "NamespacesClient": initServer(s, &s.trNamespacesServer, func() *NamespacesServerTransport { return NewNamespacesServerTransport(&s.srv.NamespacesServer) }) resp, err = s.trNamespacesServer.Do(req) + case "NetworkSecurityPerimeterConfigurationsClient": + initServer(s, &s.trNetworkSecurityPerimeterConfigurationsServer, func() *NetworkSecurityPerimeterConfigurationsServerTransport { + return NewNetworkSecurityPerimeterConfigurationsServerTransport(&s.srv.NetworkSecurityPerimeterConfigurationsServer) + }) + resp, err = s.trNetworkSecurityPerimeterConfigurationsServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) @@ -223,6 +236,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewPartnerConfigurationsServerTransport(&s.srv.PartnerConfigurationsServer) }) resp, err = s.trPartnerConfigurationsServer.Do(req) + case "PartnerDestinationsClient": + initServer(s, &s.trPartnerDestinationsServer, func() *PartnerDestinationsServerTransport { + return NewPartnerDestinationsServerTransport(&s.srv.PartnerDestinationsServer) + }) + resp, err = s.trPartnerDestinationsServer.Do(req) case "PartnerNamespacesClient": initServer(s, &s.trPartnerNamespacesServer, func() *PartnerNamespacesServerTransport { return NewPartnerNamespacesServerTransport(&s.srv.PartnerNamespacesServer) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/fake/time_rfc3339.go b/sdk/resourcemanager/eventgrid/armeventgrid/fake/time_rfc3339.go deleted file mode 100644 index 7691a451714b..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/go.mod b/sdk/resourcemanager/eventgrid/armeventgrid/go.mod index 91e35d3d5a46..5d2e96fce138 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/go.mod +++ b/sdk/resourcemanager/eventgrid/armeventgrid/go.mod @@ -4,7 +4,6 @@ go 1.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.2 // indirect diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/interfaces.go b/sdk/resourcemanager/eventgrid/armeventgrid/interfaces.go index c1fc145e4fe8..4fc012da110e 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/interfaces.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/interfaces.go @@ -40,8 +40,9 @@ type DeliveryAttributeMappingClassification interface { // Call the interface's GetEventSubscriptionDestination() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AzureFunctionEventSubscriptionDestination, *EventHubEventSubscriptionDestination, *EventSubscriptionDestination, *HybridConnectionEventSubscriptionDestination, -// - *MonitorAlertEventSubscriptionDestination, *NamespaceTopicEventSubscriptionDestination, *ServiceBusQueueEventSubscriptionDestination, -// - *ServiceBusTopicEventSubscriptionDestination, *StorageQueueEventSubscriptionDestination, *WebHookEventSubscriptionDestination +// - *MonitorAlertEventSubscriptionDestination, *NamespaceTopicEventSubscriptionDestination, *PartnerEventSubscriptionDestination, +// - *ServiceBusQueueEventSubscriptionDestination, *ServiceBusTopicEventSubscriptionDestination, *StorageQueueEventSubscriptionDestination, +// - *WebHookEventSubscriptionDestination type EventSubscriptionDestinationClassification interface { // GetEventSubscriptionDestination returns the EventSubscriptionDestination content of the underlying type. GetEventSubscriptionDestination() *EventSubscriptionDestination @@ -68,6 +69,33 @@ type InputSchemaMappingClassification interface { GetInputSchemaMapping() *InputSchemaMapping } +// PartnerClientAuthenticationClassification provides polymorphic access to related types. +// Call the interface's GetPartnerClientAuthentication() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureADPartnerClientAuthentication, *PartnerClientAuthentication +type PartnerClientAuthenticationClassification interface { + // GetPartnerClientAuthentication returns the PartnerClientAuthentication content of the underlying type. + GetPartnerClientAuthentication() *PartnerClientAuthentication +} + +// PartnerDestinationInfoClassification provides polymorphic access to related types. +// Call the interface's GetPartnerDestinationInfo() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *PartnerDestinationInfo, *WebhookPartnerDestinationInfo +type PartnerDestinationInfoClassification interface { + // GetPartnerDestinationInfo returns the PartnerDestinationInfo content of the underlying type. + GetPartnerDestinationInfo() *PartnerDestinationInfo +} + +// PartnerUpdateDestinationInfoClassification provides polymorphic access to related types. +// Call the interface's GetPartnerUpdateDestinationInfo() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *PartnerUpdateDestinationInfo, *WebhookUpdatePartnerDestinationInfo +type PartnerUpdateDestinationInfoClassification interface { + // GetPartnerUpdateDestinationInfo returns the PartnerUpdateDestinationInfo content of the underlying type. + GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo +} + // StaticRoutingEnrichmentClassification provides polymorphic access to related types. // Call the interface's GetStaticRoutingEnrichment() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/models.go b/sdk/resourcemanager/eventgrid/armeventgrid/models.go index 5c8ec0dd5578..dad3bb3d733b 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/models.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/models.go @@ -22,6 +22,32 @@ type AdvancedFilter struct { // GetAdvancedFilter implements the AdvancedFilterClassification interface for type AdvancedFilter. func (a *AdvancedFilter) GetAdvancedFilter() *AdvancedFilter { return a } +// AzureADPartnerClientAuthentication - Microsoft Entra ID Partner Client Authentication +type AzureADPartnerClientAuthentication struct { + // REQUIRED; Type of client authentication + ClientAuthenticationType *PartnerClientAuthenticationType + + // Microsoft Entra ID ClientAuthentication Properties + Properties *AzureADPartnerClientAuthenticationProperties +} + +// GetPartnerClientAuthentication implements the PartnerClientAuthenticationClassification interface for type AzureADPartnerClientAuthentication. +func (a *AzureADPartnerClientAuthentication) GetPartnerClientAuthentication() *PartnerClientAuthentication { + return &PartnerClientAuthentication{ + ClientAuthenticationType: a.ClientAuthenticationType, + } +} + +// AzureADPartnerClientAuthenticationProperties - Properties of a Microsoft Entra ID Partner Client Authentication. +type AzureADPartnerClientAuthenticationProperties struct { + // The Microsoft Entra ID Application ID or URI to get the access token that will be included as the bearer token in delivery + // requests. + AzureActiveDirectoryApplicationIDOrURI *string + + // The Microsoft Entra ID Tenant ID to get the access token that will be included as the bearer token in delivery requests. + AzureActiveDirectoryTenantID *string +} + // AzureFunctionEventSubscriptionDestination - Information about the azure function destination for an event subscription. type AzureFunctionEventSubscriptionDestination struct { // REQUIRED; Type of the endpoint for the event subscription destination. @@ -169,6 +195,10 @@ type ChannelProperties struct { // Context or helpful message that can be used during the approval process by the subscriber. MessageForActivation *string + // This property should be populated when channelType is PartnerDestination and represents information about the partner destination + // resource corresponding to the channel. + PartnerDestinationInfo PartnerDestinationInfoClassification + // This property should be populated when channelType is PartnerTopic and represents information about the partner topic resource // corresponding to the channel. PartnerTopicInfo *PartnerTopicInfo @@ -193,6 +223,9 @@ type ChannelUpdateParametersProperties struct { // destination are deleted. ExpirationTimeIfNotActivatedUTC *time.Time + // Partner destination properties which can be updated if the channel is of type PartnerDestination. + PartnerDestinationInfo PartnerUpdateDestinationInfoClassification + // Partner topic properties which can be updated if the channel is of type PartnerTopic. PartnerTopicInfo *PartnerUpdateTopicInfo } @@ -224,6 +257,18 @@ type Client struct { Type *string } +// ClientAuthenticationSettings - Client authentication settings for namespace resource. +type ClientAuthenticationSettings struct { + // Alternative authentication name sources related to client authentication settings for namespace resource. + AlternativeAuthenticationNameSources []*AlternativeAuthenticationNameSource + + // Custom JWT authentication settings for namespace resource. + CustomJwtAuthentication *CustomJwtAuthenticationSettings + + // Authentication settings for a webhook endpoint within a Namespace resource. + WebhookAuthentication *WebhookAuthenticationSettings +} + // ClientCertificateAuthentication - The certificate authentication properties for the client. type ClientCertificateAuthentication struct { // The list of thumbprints that are allowed during client authentication. This property is required only if the validationScheme @@ -365,6 +410,36 @@ type CustomDomainOwnershipValidationResult struct { CustomDomainsForTopicsConfiguration []*CustomDomainConfiguration } +// CustomJwtAuthenticationManagedIdentity - The identity information for retrieving the certificate for custom JWT authentication. +type CustomJwtAuthenticationManagedIdentity struct { + // REQUIRED; The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. + Type *CustomJwtAuthenticationManagedIdentityType + + // The user identity associated with the resource. + UserAssignedIdentity *string +} + +// CustomJwtAuthenticationSettings - Custom JWT authentication settings for namespace resource. +type CustomJwtAuthenticationSettings struct { + // Information about the encoded public certificates that are used for custom authentication. + EncodedIssuerCertificates []*EncodedIssuerCertificateInfo + + // Information about the certificates that are used for token validation. We currently support maximum 2 certificates. + IssuerCertificates []*IssuerCertificateInfo + + // Expected JWT token issuer. + TokenIssuer *string +} + +// CustomWebhookAuthenticationManagedIdentity - The identity configuration required for authenticating a custom webhook. +type CustomWebhookAuthenticationManagedIdentity struct { + // REQUIRED; The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. + Type *CustomWebhookAuthenticationManagedIdentityType + + // The user identity associated with the resource. + UserAssignedIdentity *string +} + // DeadLetterDestination - Information about the dead letter destination for an event subscription. To configure a deadletter // destination, do not directly instantiate an object of this class. Instead, instantiate an object of a // derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class. @@ -439,6 +514,9 @@ type Domain struct { // Properties of the Event Grid Domain resource. Properties *DomainProperties + // The Sku pricing tier for the Event Grid Domain resource. + SKU *ResourceSKU + // Tags of the resource. Tags map[string]*string @@ -484,8 +562,9 @@ type DomainProperties struct { // Data Residency Boundary of the resource. DataResidencyBoundary *DataResidencyBoundary - // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD - // token will be used to authenticate if user is allowed to publish to the domain. + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only Microsoft + // Entra ID token will be used to authenticate if user is allowed to publish + // to the domain. DisableLocalAuth *bool // Event Type Information for the domain. This information is provided by the publisher and can be used by the subscriber @@ -599,8 +678,9 @@ type DomainUpdateParameterProperties struct { // The data residency boundary for the domain. DataResidencyBoundary *DataResidencyBoundary - // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD - // token will be used to authenticate if user is allowed to publish to the domain. + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only Microsoft + // Entra ID token will be used to authenticate if user is allowed to publish + // to the domain. DisableLocalAuth *bool // The eventTypeInfo for the domain. @@ -626,6 +706,9 @@ type DomainUpdateParameters struct { // Properties of the resource. Properties *DomainUpdateParameterProperties + // The Sku pricing tier for the domain. + SKU *ResourceSKU + // Tags of the domains resource. Tags map[string]*string } @@ -673,6 +756,15 @@ type DynamicRoutingEnrichment struct { Value *string } +// EncodedIssuerCertificateInfo - Information about the public certificate that is used for custom authentication. +type EncodedIssuerCertificateInfo struct { + // REQUIRED; Certificate in pem format. + EncodedCertificate *string + + // REQUIRED; Identifier for the certificate. + Kid *string +} + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -795,6 +887,9 @@ type EventSubscriptionFullURL struct { // EventSubscriptionIdentity - The identity information with the event subscription. type EventSubscriptionIdentity struct { + // The details of the Federated Identity Credential (FIC) used with the resource delivery. + FederatedIdentityCredentialInfo *FederatedIdentityCredentialInfo + // The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. Type *EventSubscriptionIdentityType @@ -941,6 +1036,15 @@ type EventTypesListResult struct { Value []*EventType } +// ExtendedLocation - Definition of an Extended Location +type ExtendedLocation struct { + // Fully qualified name of the extended location. + Name *string + + // Type of the extended location. + Type *string +} + // ExtensionTopic - Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. type ExtensionTopic struct { // Properties of the extension topic. @@ -968,6 +1072,12 @@ type ExtensionTopicProperties struct { SystemTopic *string } +// FederatedIdentityCredentialInfo - The details of the Federated Identity Credential (FIC) used with the resource. +type FederatedIdentityCredentialInfo struct { + // REQUIRED; The Multi-Tenant Microsoft Entra ID Application where the Federated Identity Credential (FIC) is associated with. + FederatedClientID *string +} + // Filter - This is the base type that represents a filter. To configure a filter, do not directly instantiate an object of // this class. Instead, instantiate an object of a derived class such as BoolEqualsFilter, // NumberInFilter etc depending on the type of the key based on which you want to filter. @@ -1139,6 +1249,16 @@ func (i *IsNullOrUndefinedFilter) GetFilter() *Filter { } } +// IssuerCertificateInfo - Information about the certificate that is used for token validation. +type IssuerCertificateInfo struct { + // REQUIRED; Keyvault certificate URL in https://keyvaultname.vault.azure.net/certificates/certificateName/certificateVersion + // format. + CertificateURL *string + + // The identity that will be used to access the certificate. + Identity *CustomJwtAuthenticationManagedIdentity +} + // JSONField - This is used to express the source of an input schema mapping for a single target field in the Event Grid Event // schema. This is currently used in the mappings for the 'id', 'topic' and 'eventtime' // properties. This represents a field in the input event schema. @@ -1442,6 +1562,151 @@ type NamespacesListResult struct { Value []*Namespace } +// NetworkSecurityPerimeterConfiguration - Network security perimeter configuration. +type NetworkSecurityPerimeterConfiguration struct { + // Properties of the network security perimeter configuration. + Properties *NetworkSecurityPerimeterConfigurationProperties + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string + + // READ-ONLY; Name of the resource. + Name *string + + // READ-ONLY; Type of the resource. + Type *string +} + +// NetworkSecurityPerimeterConfigurationIssues - Network security perimeter configuration issues. +type NetworkSecurityPerimeterConfigurationIssues struct { + // Provisioning issue name. + Name *string + + // Provisioning issue properties. + Properties *NetworkSecurityPerimeterConfigurationIssuesProperties +} + +// NetworkSecurityPerimeterConfigurationIssuesProperties - Network security perimeter configuration issues properties. +type NetworkSecurityPerimeterConfigurationIssuesProperties struct { + // Provisioning issue description. + Description *string + + // Provisioning issue type. + IssueType *NetworkSecurityPerimeterConfigurationIssueType + + // Provisioning issue severity. + Severity *NetworkSecurityPerimeterConfigurationIssueSeverity + + // Access rules that can be added to the same profile to remediate the issue. + SuggestedAccessRules []*string + + // ARM IDs of resources that can be associated to the same perimeter to remediate the issue. + SuggestedResourceIDs []*string +} + +// NetworkSecurityPerimeterConfigurationList - Network security perimeter configuration List. +type NetworkSecurityPerimeterConfigurationList struct { + // A link for the next page of Network Security Perimeter Configuration. + NextLink *string + + // List of all network security parameter configurations. + Value []*NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationProfile - Nsp configuration with profile information. +type NetworkSecurityPerimeterConfigurationProfile struct { + // List of inbound or outbound access rule setup on the nsp profile. + AccessRules []*NetworkSecurityPerimeterProfileAccessRule + + // Access rules version number for nsp profile. + AccessRulesVersion *string + + // Diagnostic settings version number for nsp profile. + DiagnosticSettingsVersion *string + + // Enabled log categories for nsp profile. + EnabledLogCategories []*string + + // Nsp configuration profile name. + Name *string +} + +// NetworkSecurityPerimeterConfigurationProperties - Network security perimeter configuration information to reflect latest +// association and nsp profile configuration. +type NetworkSecurityPerimeterConfigurationProperties struct { + // Perimeter info for nsp association. + NetworkSecurityPerimeter *NetworkSecurityPerimeterInfo + + // Nsp profile configuration, access rules and diagnostic settings. + Profile *NetworkSecurityPerimeterConfigurationProfile + + // Provisioning issues to reflect status when attempting to retrieve nsp profile configuration. + ProvisioningIssues []*NetworkSecurityPerimeterConfigurationIssues + + // Provisioning state to reflect configuration state and indicate status of nsp profile configuration retrieval. + ProvisioningState *NetworkSecurityPerimeterConfigProvisioningState + + // Nsp association name and access mode of association. + ResourceAssociation *ResourceAssociation +} + +// NetworkSecurityPerimeterInfo - Network security perimeter info. +type NetworkSecurityPerimeterInfo struct { + // Arm id for network security perimeter. + ID *string + + // Network security perimeter location. + Location *string + + // Network security perimeter guid. + PerimeterGUID *string +} + +// NetworkSecurityPerimeterProfileAccessRule - Network security perimeter profile access rule. +type NetworkSecurityPerimeterProfileAccessRule struct { + // Fully Qualified Arm id for network security perimeter profile access rule. + FullyQualifiedArmID *string + + // Name for nsp access rule. + Name *string + + // NSP access rule properties. + Properties *NetworkSecurityPerimeterProfileAccessRuleProperties + + // nsp access rule type. + Type *string +} + +// NetworkSecurityPerimeterProfileAccessRuleProperties - Network security perimeter profile access rule properties. +type NetworkSecurityPerimeterProfileAccessRuleProperties struct { + // Address prefixes. + AddressPrefixes []*string + + // NSP access rule direction. + Direction *NetworkSecurityPerimeterProfileAccessRuleDirection + + // List of email addresses. + EmailAddresses []*string + + // Fully qualified domain names. + FullyQualifiedDomainNames []*string + + // Network security perimeters. + NetworkSecurityPerimeters []*NetworkSecurityPerimeterInfo + + // List of phone numbers. + PhoneNumbers []*string + + // List of subscriptions. + Subscriptions []*NetworkSecurityPerimeterSubscription +} + +// NetworkSecurityPerimeterSubscription - Network security perimeter subscription inbound access rule. +type NetworkSecurityPerimeterSubscription struct { + // Subscription id. + ID *string +} + // NumberGreaterThanAdvancedFilter - NumberGreaterThan Advanced Filter. type NumberGreaterThanAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1828,6 +2093,17 @@ type PartnerAuthorization struct { DefaultMaximumExpirationTimeInDays *int32 } +// PartnerClientAuthentication - Partner client authentication +type PartnerClientAuthentication struct { + // REQUIRED; Type of client authentication + ClientAuthenticationType *PartnerClientAuthenticationType +} + +// GetPartnerClientAuthentication implements the PartnerClientAuthenticationClassification interface for type PartnerClientAuthentication. +func (p *PartnerClientAuthentication) GetPartnerClientAuthentication() *PartnerClientAuthentication { + return p +} + // PartnerConfiguration - Partner configuration information type PartnerConfiguration struct { // Location of the resource. @@ -1886,6 +2162,96 @@ type PartnerConfigurationsListResult struct { Value []*PartnerConfiguration } +// PartnerDestination - Event Grid Partner Destination. +type PartnerDestination struct { + // REQUIRED; Location of the resource. + Location *string + + // Properties of the Partner Destination. + Properties *PartnerDestinationProperties + + // Tags of the resource. + Tags map[string]*string + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string + + // READ-ONLY; Name of the resource. + Name *string + + // READ-ONLY; The system metadata relating to the Event Grid resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// PartnerDestinationInfo - Properties of the corresponding partner destination of a Channel. +type PartnerDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType + + // Azure subscription ID of the subscriber. The partner destination associated with the channel will be created under this + // Azure subscription. + AzureSubscriptionID *string + + // Additional context of the partner destination endpoint. + EndpointServiceContext *string + + // Name of the partner destination associated with the channel. + Name *string + + // Azure Resource Group of the subscriber. The partner destination associated with the channel will be created under this + // resource group. + ResourceGroupName *string + + // Change history of the resource move. + ResourceMoveChangeHistory []*ResourceMoveChangeHistory +} + +// GetPartnerDestinationInfo implements the PartnerDestinationInfoClassification interface for type PartnerDestinationInfo. +func (p *PartnerDestinationInfo) GetPartnerDestinationInfo() *PartnerDestinationInfo { return p } + +// PartnerDestinationProperties - Properties of the Partner Destination. +type PartnerDestinationProperties struct { + // Activation state of the partner destination. + ActivationState *PartnerDestinationActivationState + + // Endpoint Base URL of the partner destination + EndpointBaseURL *string + + // Endpoint context associated with this partner destination. + EndpointServiceContext *string + + // Expiration time of the partner destination. If this timer expires and the partner destination was never activated, the + // partner destination and corresponding channel are deleted. + ExpirationTimeIfNotActivatedUTC *time.Time + + // Context or helpful message that can be used during the approval process. + MessageForActivation *string + + // The immutable Id of the corresponding partner registration. + PartnerRegistrationImmutableID *string + + // READ-ONLY; Provisioning state of the partner destination. + ProvisioningState *PartnerDestinationProvisioningState +} + +// PartnerDestinationUpdateParameters - Properties of the Partner Destination that can be updated. +type PartnerDestinationUpdateParameters struct { + // Tags of the Partner Destination resource. + Tags map[string]*string +} + +// PartnerDestinationsListResult - Result of the List Partner Destinations operation. +type PartnerDestinationsListResult struct { + // A link for the next page of partner destinations. + NextLink *string + + // A collection of partner destinations. + Value []*PartnerDestination +} + // PartnerDetails - Information about the partner. type PartnerDetails struct { // This is short description about the partner. The length of this description should not exceed 256 characters. @@ -1898,6 +2264,26 @@ type PartnerDetails struct { SetupURI *string } +type PartnerEventSubscriptionDestination struct { + // REQUIRED; Type of the endpoint for the event subscription destination. + EndpointType *EndpointType + + // Partner Destination Properties of the event subscription destination. + Properties *PartnerEventSubscriptionDestinationProperties +} + +// GetEventSubscriptionDestination implements the EventSubscriptionDestinationClassification interface for type PartnerEventSubscriptionDestination. +func (p *PartnerEventSubscriptionDestination) GetEventSubscriptionDestination() *EventSubscriptionDestination { + return &EventSubscriptionDestination{ + EndpointType: p.EndpointType, + } +} + +type PartnerEventSubscriptionDestinationProperties struct { + // The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + ResourceID *string +} + // PartnerNamespace - EventGrid Partner Namespace. type PartnerNamespace struct { // REQUIRED; Location of the resource. @@ -1924,9 +2310,9 @@ type PartnerNamespace struct { // PartnerNamespaceProperties - Properties of the partner namespace. type PartnerNamespaceProperties struct { - // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD - // token will be used to authenticate if user is allowed to publish to the partner - // namespace. + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only Microsoft + // Entra ID token will be used to authenticate if user is allowed to publish + // to the partner namespace. DisableLocalAuth *bool // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess @@ -1977,9 +2363,9 @@ type PartnerNamespaceSharedAccessKeys struct { // PartnerNamespaceUpdateParameterProperties - Information of Partner Namespace update parameter properties. type PartnerNamespaceUpdateParameterProperties struct { - // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD - // token will be used to authenticate if user is allowed to publish to the partner - // namespace. + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only Microsoft + // Entra ID token will be used to authenticate if user is allowed to publish + // to the partner namespace. DisableLocalAuth *bool // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess @@ -2159,6 +2545,17 @@ type PartnerTopicsListResult struct { Value []*PartnerTopic } +// PartnerUpdateDestinationInfo - Properties of the corresponding partner destination of a Channel. +type PartnerUpdateDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType +} + +// GetPartnerUpdateDestinationInfo implements the PartnerUpdateDestinationInfoClassification interface for type PartnerUpdateDestinationInfo. +func (p *PartnerUpdateDestinationInfo) GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo { + return p +} + // PartnerUpdateTopicInfo - Update properties for the corresponding partner topic of a channel. type PartnerUpdateTopicInfo struct { // Event type info for the partner topic @@ -2371,6 +2768,33 @@ type Resource struct { Type *string } +// ResourceAssociation - Nsp resource association +type ResourceAssociation struct { + // Network security perimeter access mode. + AccessMode *NetworkSecurityPerimeterAssociationAccessMode + + // Association name + Name *string +} + +// ResourceMoveChangeHistory - The change history of the resource move. +type ResourceMoveChangeHistory struct { + // Azure subscription ID of the resource. + AzureSubscriptionID *string + + // UTC timestamp of when the resource was changed. + ChangedTimeUTC *time.Time + + // Azure Resource Group of the resource. + ResourceGroupName *string +} + +// ResourceSKU - Describes an EventGrid Resource Sku. +type ResourceSKU struct { + // The Sku name of the resource. The possible values are: Basic or Premium. + Name *SKU +} + // RetryPolicy - Information about the retry policy for an event subscription. type RetryPolicy struct { // Time To Live (in minutes) for events. @@ -2916,6 +3340,9 @@ type SubscriptionProperties struct { // Information about the filter for the event subscription. FiltersConfiguration *FiltersConfiguration + // Tags relating to Event Subscription resource. + Tags map[string]*string + // READ-ONLY; Provisioning state of the event subscription. ProvisioningState *SubscriptionProvisioningState } @@ -2939,6 +3366,9 @@ type SubscriptionUpdateParametersProperties struct { // Information about the filter for the event subscription. FiltersConfiguration *FiltersConfiguration + + // Tags relating to Event Subscription resource. + Tags map[string]*string } // SubscriptionsListResult - Result of the List event subscriptions operation. @@ -3036,12 +3466,21 @@ type Topic struct { // REQUIRED; Location of the resource. Location *string + // Extended location of the resource. + ExtendedLocation *ExtendedLocation + // Identity information for the resource. Identity *IdentityInfo + // Kind of the resource. + Kind *ResourceKind + // Properties of the topic. Properties *TopicProperties + // The Sku pricing tier for the topic. + SKU *ResourceSKU + // Tags of the resource. Tags map[string]*string @@ -3063,8 +3502,9 @@ type TopicProperties struct { // Data Residency Boundary of the resource. DataResidencyBoundary *DataResidencyBoundary - // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD - // token will be used to authenticate if user is allowed to publish to the topic. + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only Microsoft + // Entra ID token will be used to authenticate if user is allowed to publish + // to the topic. DisableLocalAuth *bool // Event Type Information for the user topic. This information is provided by the publisher and can be used by the subscriber @@ -3150,6 +3590,9 @@ type TopicSpaceProperties struct { // TopicSpacesConfiguration - Properties of the Topic Spaces Configuration. type TopicSpacesConfiguration struct { + // Client authentication settings for topic spaces configuration. + ClientAuthentication *ClientAuthenticationSettings + // List of custom domain configurations for the namespace. CustomDomains []*CustomDomainConfiguration @@ -3253,8 +3696,9 @@ type TopicUpdateParameterProperties struct { // The data residency boundary for the topic. DataResidencyBoundary *DataResidencyBoundary - // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD - // token will be used to authenticate if user is allowed to publish to the topic. + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only Microsoft + // Entra ID token will be used to authenticate if user is allowed to publish + // to the topic. DisableLocalAuth *bool // The eventTypeInfo for the topic. @@ -3280,6 +3724,9 @@ type TopicUpdateParameters struct { // Properties of the Topic resource. Properties *TopicUpdateParameterProperties + // The Sku pricing tier for the topic. + SKU *ResourceSKU + // Tags of the Topic resource. Tags map[string]*string } @@ -3322,6 +3769,9 @@ type TrackedResource struct { // UpdateTopicSpacesConfigurationInfo - Properties of the topic spaces configuration info of a namespace. type UpdateTopicSpacesConfigurationInfo struct { + // Client authentication settings for topic spaces configuration. + ClientAuthentication *ClientAuthenticationSettings + // Custom domain info for topic spaces configuration. CustomDomains []*CustomDomainConfiguration @@ -3384,6 +3834,9 @@ type VerifiedPartnerProperties struct { // Official name of the Partner. OrganizationName *string + // Details of the partner destination scenario. + PartnerDestinationDetails *PartnerDetails + // Display name of the verified partner. PartnerDisplayName *string @@ -3424,11 +3877,11 @@ func (w *WebHookEventSubscriptionDestination) GetEventSubscriptionDestination() // WebHookEventSubscriptionDestinationProperties - Information about the webhook destination properties for an event subscription. type WebHookEventSubscriptionDestinationProperties struct { - // The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery + // The Microsoft Entra ID Application ID or URI to get the access token that will be included as the bearer token in delivery // requests. AzureActiveDirectoryApplicationIDOrURI *string - // The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + // The Microsoft Entra ID Tenant ID to get the access token that will be included as the bearer token in delivery requests. AzureActiveDirectoryTenantID *string // Delivery attribute details. @@ -3449,3 +3902,89 @@ type WebHookEventSubscriptionDestinationProperties struct { // READ-ONLY; The base URL that represents the endpoint of the destination of an event subscription. EndpointBaseURL *string } + +// WebhookAuthenticationSettings - Authentication settings for a webhook endpoint within a Namespace resource. +type WebhookAuthenticationSettings struct { + // REQUIRED; Microsoft Entra ID Application ID or URI to get the access token that will be included as the bearer token in + // delivery requests. + AzureActiveDirectoryApplicationIDOrURI *string + + // REQUIRED; Microsoft Entra ID Tenant ID to get the access token that will be included as the bearer token in delivery requests. + AzureActiveDirectoryTenantID *string + + // REQUIRED; The URL endpoint where the Event Grid service sends authenticated webhook requests using the specified managed + // identity. + EndpointURL *string + + // REQUIRED; The identity configuration required for authenticating a custom webhook. + Identity *CustomWebhookAuthenticationManagedIdentity + + // The base URL endpoint where the Event Grid service sends authenticated webhook requests using the specified managed identity. + EndpointBaseURL *string +} + +// WebhookPartnerDestinationInfo - Information about the WebHook of the partner destination. +type WebhookPartnerDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType + + // Azure subscription ID of the subscriber. The partner destination associated with the channel will be created under this + // Azure subscription. + AzureSubscriptionID *string + + // Additional context of the partner destination endpoint. + EndpointServiceContext *string + + // Name of the partner destination associated with the channel. + Name *string + + // WebHook Properties of the partner destination. + Properties *WebhookPartnerDestinationProperties + + // Azure Resource Group of the subscriber. The partner destination associated with the channel will be created under this + // resource group. + ResourceGroupName *string + + // Change history of the resource move. + ResourceMoveChangeHistory []*ResourceMoveChangeHistory +} + +// GetPartnerDestinationInfo implements the PartnerDestinationInfoClassification interface for type WebhookPartnerDestinationInfo. +func (w *WebhookPartnerDestinationInfo) GetPartnerDestinationInfo() *PartnerDestinationInfo { + return &PartnerDestinationInfo{ + AzureSubscriptionID: w.AzureSubscriptionID, + EndpointServiceContext: w.EndpointServiceContext, + EndpointType: w.EndpointType, + Name: w.Name, + ResourceGroupName: w.ResourceGroupName, + ResourceMoveChangeHistory: w.ResourceMoveChangeHistory, + } +} + +// WebhookPartnerDestinationProperties - Properties of a partner destination webhook. +type WebhookPartnerDestinationProperties struct { + // Partner client authentication + ClientAuthentication PartnerClientAuthenticationClassification + + // The base URL that represents the endpoint of the partner destination. + EndpointBaseURL *string + + // The URL that represents the endpoint of the partner destination. + EndpointURL *string +} + +// WebhookUpdatePartnerDestinationInfo - Information about the update of the WebHook of the partner destination. +type WebhookUpdatePartnerDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType + + // WebHook Properties of the partner destination. + Properties *WebhookPartnerDestinationProperties +} + +// GetPartnerUpdateDestinationInfo implements the PartnerUpdateDestinationInfoClassification interface for type WebhookUpdatePartnerDestinationInfo. +func (w *WebhookUpdatePartnerDestinationInfo) GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo { + return &PartnerUpdateDestinationInfo{ + EndpointType: w.EndpointType, + } +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/models_serde.go b/sdk/resourcemanager/eventgrid/armeventgrid/models_serde.go index 150eed302397..d0f45fe3d261 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/models_serde.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/models_serde.go @@ -43,6 +43,68 @@ func (a *AdvancedFilter) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureADPartnerClientAuthentication. +func (a AzureADPartnerClientAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["clientAuthenticationType"] = PartnerClientAuthenticationTypeAzureAD + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADPartnerClientAuthentication. +func (a *AzureADPartnerClientAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAuthenticationType": + err = unpopulate(val, "ClientAuthenticationType", &a.ClientAuthenticationType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureADPartnerClientAuthenticationProperties. +func (a AzureADPartnerClientAuthenticationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureActiveDirectoryApplicationIdOrUri", a.AzureActiveDirectoryApplicationIDOrURI) + populate(objectMap, "azureActiveDirectoryTenantId", a.AzureActiveDirectoryTenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADPartnerClientAuthenticationProperties. +func (a *AzureADPartnerClientAuthenticationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureActiveDirectoryApplicationIdOrUri": + err = unpopulate(val, "AzureActiveDirectoryApplicationIDOrURI", &a.AzureActiveDirectoryApplicationIDOrURI) + delete(rawMsg, key) + case "azureActiveDirectoryTenantId": + err = unpopulate(val, "AzureActiveDirectoryTenantID", &a.AzureActiveDirectoryTenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AzureFunctionEventSubscriptionDestination. func (a AzureFunctionEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -349,6 +411,7 @@ func (c ChannelProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "channelType", c.ChannelType) populateDateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", c.ExpirationTimeIfNotActivatedUTC) populate(objectMap, "messageForActivation", c.MessageForActivation) + populate(objectMap, "partnerDestinationInfo", c.PartnerDestinationInfo) populate(objectMap, "partnerTopicInfo", c.PartnerTopicInfo) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "readinessState", c.ReadinessState) @@ -373,6 +436,9 @@ func (c *ChannelProperties) UnmarshalJSON(data []byte) error { case "messageForActivation": err = unpopulate(val, "MessageForActivation", &c.MessageForActivation) delete(rawMsg, key) + case "partnerDestinationInfo": + c.PartnerDestinationInfo, err = unmarshalPartnerDestinationInfoClassification(val) + delete(rawMsg, key) case "partnerTopicInfo": err = unpopulate(val, "PartnerTopicInfo", &c.PartnerTopicInfo) delete(rawMsg, key) @@ -421,6 +487,7 @@ func (c *ChannelUpdateParameters) UnmarshalJSON(data []byte) error { func (c ChannelUpdateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", c.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "partnerDestinationInfo", c.PartnerDestinationInfo) populate(objectMap, "partnerTopicInfo", c.PartnerTopicInfo) return json.Marshal(objectMap) } @@ -437,6 +504,9 @@ func (c *ChannelUpdateParametersProperties) UnmarshalJSON(data []byte) error { case "expirationTimeIfNotActivatedUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &c.ExpirationTimeIfNotActivatedUTC) delete(rawMsg, key) + case "partnerDestinationInfo": + c.PartnerDestinationInfo, err = unmarshalPartnerUpdateDestinationInfoClassification(val) + delete(rawMsg, key) case "partnerTopicInfo": err = unpopulate(val, "PartnerTopicInfo", &c.PartnerTopicInfo) delete(rawMsg, key) @@ -522,6 +592,41 @@ func (c *Client) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ClientAuthenticationSettings. +func (c ClientAuthenticationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "alternativeAuthenticationNameSources", c.AlternativeAuthenticationNameSources) + populate(objectMap, "customJwtAuthentication", c.CustomJwtAuthentication) + populate(objectMap, "webhookAuthentication", c.WebhookAuthentication) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientAuthenticationSettings. +func (c *ClientAuthenticationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alternativeAuthenticationNameSources": + err = unpopulate(val, "AlternativeAuthenticationNameSources", &c.AlternativeAuthenticationNameSources) + delete(rawMsg, key) + case "customJwtAuthentication": + err = unpopulate(val, "CustomJwtAuthentication", &c.CustomJwtAuthentication) + delete(rawMsg, key) + case "webhookAuthentication": + err = unpopulate(val, "WebhookAuthentication", &c.WebhookAuthentication) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ClientCertificateAuthentication. func (c ClientCertificateAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -884,6 +989,103 @@ func (c *CustomDomainOwnershipValidationResult) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type CustomJwtAuthenticationManagedIdentity. +func (c CustomJwtAuthenticationManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", c.Type) + populate(objectMap, "userAssignedIdentity", c.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomJwtAuthenticationManagedIdentity. +func (c *CustomJwtAuthenticationManagedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &c.UserAssignedIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomJwtAuthenticationSettings. +func (c CustomJwtAuthenticationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encodedIssuerCertificates", c.EncodedIssuerCertificates) + populate(objectMap, "issuerCertificates", c.IssuerCertificates) + populate(objectMap, "tokenIssuer", c.TokenIssuer) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomJwtAuthenticationSettings. +func (c *CustomJwtAuthenticationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encodedIssuerCertificates": + err = unpopulate(val, "EncodedIssuerCertificates", &c.EncodedIssuerCertificates) + delete(rawMsg, key) + case "issuerCertificates": + err = unpopulate(val, "IssuerCertificates", &c.IssuerCertificates) + delete(rawMsg, key) + case "tokenIssuer": + err = unpopulate(val, "TokenIssuer", &c.TokenIssuer) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomWebhookAuthenticationManagedIdentity. +func (c CustomWebhookAuthenticationManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", c.Type) + populate(objectMap, "userAssignedIdentity", c.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomWebhookAuthenticationManagedIdentity. +func (c *CustomWebhookAuthenticationManagedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &c.UserAssignedIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DeadLetterDestination. func (d DeadLetterDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1074,6 +1276,7 @@ func (d Domain) MarshalJSON() ([]byte, error) { populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) populate(objectMap, "systemData", d.SystemData) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) @@ -1104,6 +1307,9 @@ func (d *Domain) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) @@ -1419,6 +1625,7 @@ func (d DomainUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", d.Identity) populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } @@ -1438,6 +1645,9 @@ func (d *DomainUpdateParameters) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) @@ -1573,6 +1783,37 @@ func (d *DynamicRoutingEnrichment) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EncodedIssuerCertificateInfo. +func (e EncodedIssuerCertificateInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encodedCertificate", e.EncodedCertificate) + populate(objectMap, "kid", e.Kid) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedIssuerCertificateInfo. +func (e *EncodedIssuerCertificateInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encodedCertificate": + err = unpopulate(val, "EncodedCertificate", &e.EncodedCertificate) + delete(rawMsg, key) + case "kid": + err = unpopulate(val, "Kid", &e.Kid) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1883,6 +2124,7 @@ func (e *EventSubscriptionFullURL) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EventSubscriptionIdentity. func (e EventSubscriptionIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "federatedIdentityCredentialInfo", e.FederatedIdentityCredentialInfo) populate(objectMap, "type", e.Type) populate(objectMap, "userAssignedIdentity", e.UserAssignedIdentity) return json.Marshal(objectMap) @@ -1897,6 +2139,9 @@ func (e *EventSubscriptionIdentity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "federatedIdentityCredentialInfo": + err = unpopulate(val, "FederatedIdentityCredentialInfo", &e.FederatedIdentityCredentialInfo) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) @@ -2204,6 +2449,37 @@ func (e *EventTypesListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. +func (e ExtendedLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. +func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExtensionTopic. func (e ExtensionTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2278,6 +2554,33 @@ func (e *ExtensionTopicProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FederatedIdentityCredentialInfo. +func (f FederatedIdentityCredentialInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "federatedClientId", f.FederatedClientID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FederatedIdentityCredentialInfo. +func (f *FederatedIdentityCredentialInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "federatedClientId": + err = unpopulate(val, "FederatedClientID", &f.FederatedClientID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Filter. func (f Filter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2662,6 +2965,37 @@ func (i *IsNullOrUndefinedFilter) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IssuerCertificateInfo. +func (i IssuerCertificateInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateUrl", i.CertificateURL) + populate(objectMap, "identity", i.Identity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssuerCertificateInfo. +func (i *IssuerCertificateInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateUrl": + err = unpopulate(val, "CertificateURL", &i.CertificateURL) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &i.Identity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type JSONField. func (j JSONField) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3401,17 +3735,18 @@ func (n *NamespacesListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberGreaterThanAdvancedFilter. -func (n NumberGreaterThanAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberGreaterThan - populate(objectMap, "value", n.Value) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanAdvancedFilter. -func (n *NumberGreaterThanAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) @@ -3419,7 +3754,388 @@ func (n *NumberGreaterThanAdvancedFilter) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key": + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationIssues. +func (n NetworkSecurityPerimeterConfigurationIssues) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationIssues. +func (n *NetworkSecurityPerimeterConfigurationIssues) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationIssuesProperties. +func (n NetworkSecurityPerimeterConfigurationIssuesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "issueType", n.IssueType) + populate(objectMap, "severity", n.Severity) + populate(objectMap, "suggestedAccessRules", n.SuggestedAccessRules) + populate(objectMap, "suggestedResourceIds", n.SuggestedResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationIssuesProperties. +func (n *NetworkSecurityPerimeterConfigurationIssuesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "issueType": + err = unpopulate(val, "IssueType", &n.IssueType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &n.Severity) + delete(rawMsg, key) + case "suggestedAccessRules": + err = unpopulate(val, "SuggestedAccessRules", &n.SuggestedAccessRules) + delete(rawMsg, key) + case "suggestedResourceIds": + err = unpopulate(val, "SuggestedResourceIDs", &n.SuggestedResourceIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n NetworkSecurityPerimeterConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n *NetworkSecurityPerimeterConfigurationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProfile. +func (n NetworkSecurityPerimeterConfigurationProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "diagnosticSettingsVersion", n.DiagnosticSettingsVersion) + populate(objectMap, "enabledLogCategories", n.EnabledLogCategories) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProfile. +func (n *NetworkSecurityPerimeterConfigurationProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessRules": + err = unpopulate(val, "AccessRules", &n.AccessRules) + delete(rawMsg, key) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) + delete(rawMsg, key) + case "diagnosticSettingsVersion": + err = unpopulate(val, "DiagnosticSettingsVersion", &n.DiagnosticSettingsVersion) + delete(rawMsg, key) + case "enabledLogCategories": + err = unpopulate(val, "EnabledLogCategories", &n.EnabledLogCategories) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterInfo. +func (n NetworkSecurityPerimeterInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterInfo. +func (n *NetworkSecurityPerimeterInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterProfileAccessRule. +func (n NetworkSecurityPerimeterProfileAccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fullyQualifiedArmId", n.FullyQualifiedArmID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterProfileAccessRule. +func (n *NetworkSecurityPerimeterProfileAccessRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fullyQualifiedArmId": + err = unpopulate(val, "FullyQualifiedArmID", &n.FullyQualifiedArmID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterProfileAccessRuleProperties. +func (n NetworkSecurityPerimeterProfileAccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", n.AddressPrefixes) + populate(objectMap, "direction", n.Direction) + populate(objectMap, "emailAddresses", n.EmailAddresses) + populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) + populate(objectMap, "phoneNumbers", n.PhoneNumbers) + populate(objectMap, "subscriptions", n.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterProfileAccessRuleProperties. +func (n *NetworkSecurityPerimeterProfileAccessRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &n.Direction) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &n.EmailAddresses) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "phoneNumbers": + err = unpopulate(val, "PhoneNumbers", &n.PhoneNumbers) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &n.Subscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterSubscription. +func (n NetworkSecurityPerimeterSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterSubscription. +func (n *NetworkSecurityPerimeterSubscription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NumberGreaterThanAdvancedFilter. +func (n NumberGreaterThanAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberGreaterThan + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanAdvancedFilter. +func (n *NumberGreaterThanAdvancedFilter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": @@ -4136,6 +4852,33 @@ func (p *PartnerAuthorization) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PartnerClientAuthentication. +func (p PartnerClientAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["clientAuthenticationType"] = p.ClientAuthenticationType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerClientAuthentication. +func (p *PartnerClientAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAuthenticationType": + err = unpopulate(val, "ClientAuthenticationType", &p.ClientAuthenticationType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PartnerConfiguration. func (p PartnerConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4296,8 +5039,281 @@ func (p *PartnerConfigurationsListResult) UnmarshalJSON(data []byte) error { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestination. +func (p PartnerDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDestination. +func (p *PartnerDestination) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationInfo. +func (p PartnerDestinationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureSubscriptionId", p.AzureSubscriptionID) + populate(objectMap, "endpointServiceContext", p.EndpointServiceContext) + objectMap["endpointType"] = p.EndpointType + populate(objectMap, "name", p.Name) + populate(objectMap, "resourceGroupName", p.ResourceGroupName) + populate(objectMap, "resourceMoveChangeHistory", p.ResourceMoveChangeHistory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDestinationInfo. +func (p *PartnerDestinationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureSubscriptionId": + err = unpopulate(val, "AzureSubscriptionID", &p.AzureSubscriptionID) + delete(rawMsg, key) + case "endpointServiceContext": + err = unpopulate(val, "EndpointServiceContext", &p.EndpointServiceContext) + delete(rawMsg, key) + case "endpointType": + err = unpopulate(val, "EndpointType", &p.EndpointType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &p.ResourceGroupName) + delete(rawMsg, key) + case "resourceMoveChangeHistory": + err = unpopulate(val, "ResourceMoveChangeHistory", &p.ResourceMoveChangeHistory) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationProperties. +func (p PartnerDestinationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activationState", p.ActivationState) + populate(objectMap, "endpointBaseUrl", p.EndpointBaseURL) + populate(objectMap, "endpointServiceContext", p.EndpointServiceContext) + populateDateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", p.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "messageForActivation", p.MessageForActivation) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDestinationProperties. +func (p *PartnerDestinationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activationState": + err = unpopulate(val, "ActivationState", &p.ActivationState) + delete(rawMsg, key) + case "endpointBaseUrl": + err = unpopulate(val, "EndpointBaseURL", &p.EndpointBaseURL) + delete(rawMsg, key) + case "endpointServiceContext": + err = unpopulate(val, "EndpointServiceContext", &p.EndpointServiceContext) + delete(rawMsg, key) + case "expirationTimeIfNotActivatedUtc": + err = unpopulateDateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &p.ExpirationTimeIfNotActivatedUTC) + delete(rawMsg, key) + case "messageForActivation": + err = unpopulate(val, "MessageForActivation", &p.MessageForActivation) + delete(rawMsg, key) + case "partnerRegistrationImmutableId": + err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationUpdateParameters. +func (p PartnerDestinationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDestinationUpdateParameters. +func (p *PartnerDestinationUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationsListResult. +func (p PartnerDestinationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDestinationsListResult. +func (p *PartnerDestinationsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDetails. +func (p PartnerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "longDescription", p.LongDescription) + populate(objectMap, "setupUri", p.SetupURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDetails. +func (p *PartnerDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "longDescription": + err = unpopulate(val, "LongDescription", &p.LongDescription) + delete(rawMsg, key) + case "setupUri": + err = unpopulate(val, "SetupURI", &p.SetupURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerEventSubscriptionDestination. +func (p PartnerEventSubscriptionDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["endpointType"] = EndpointTypePartnerDestination + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerEventSubscriptionDestination. +func (p *PartnerEventSubscriptionDestination) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &p.EndpointType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) } if err != nil { @@ -4307,17 +5323,15 @@ func (p *PartnerConfigurationsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerDetails. -func (p PartnerDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerEventSubscriptionDestinationProperties. +func (p PartnerEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", p.Description) - populate(objectMap, "longDescription", p.LongDescription) - populate(objectMap, "setupUri", p.SetupURI) + populate(objectMap, "resourceId", p.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDetails. -func (p *PartnerDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerEventSubscriptionDestinationProperties. +func (p *PartnerEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -4325,14 +5339,8 @@ func (p *PartnerDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "longDescription": - err = unpopulate(val, "LongDescription", &p.LongDescription) - delete(rawMsg, key) - case "setupUri": - err = unpopulate(val, "SetupURI", &p.SetupURI) + case "resourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) delete(rawMsg, key) } if err != nil { @@ -4966,6 +5974,33 @@ func (p *PartnerTopicsListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PartnerUpdateDestinationInfo. +func (p PartnerUpdateDestinationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["endpointType"] = p.EndpointType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerUpdateDestinationInfo. +func (p *PartnerUpdateDestinationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &p.EndpointType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PartnerUpdateTopicInfo. func (p PartnerUpdateTopicInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5472,6 +6507,99 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceAssociation. +func (r ResourceAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessMode", r.AccessMode) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAssociation. +func (r *ResourceAssociation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessMode": + err = unpopulate(val, "AccessMode", &r.AccessMode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMoveChangeHistory. +func (r ResourceMoveChangeHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureSubscriptionId", r.AzureSubscriptionID) + populateDateTimeRFC3339(objectMap, "changedTimeUtc", r.ChangedTimeUTC) + populate(objectMap, "resourceGroupName", r.ResourceGroupName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveChangeHistory. +func (r *ResourceMoveChangeHistory) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureSubscriptionId": + err = unpopulate(val, "AzureSubscriptionID", &r.AzureSubscriptionID) + delete(rawMsg, key) + case "changedTimeUtc": + err = unpopulateDateTimeRFC3339(val, "ChangedTimeUTC", &r.ChangedTimeUTC) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &r.ResourceGroupName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKU. +func (r ResourceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU. +func (r *ResourceSKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RetryPolicy. func (r RetryPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6587,6 +7715,7 @@ func (s SubscriptionProperties) MarshalJSON() ([]byte, error) { populateDateTimeRFC3339(objectMap, "expirationTimeUtc", s.ExpirationTimeUTC) populate(objectMap, "filtersConfiguration", s.FiltersConfiguration) populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } @@ -6614,6 +7743,9 @@ func (s *SubscriptionProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -6656,6 +7788,7 @@ func (s SubscriptionUpdateParametersProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "eventDeliverySchema", s.EventDeliverySchema) populateDateTimeRFC3339(objectMap, "expirationTimeUtc", s.ExpirationTimeUTC) populate(objectMap, "filtersConfiguration", s.FiltersConfiguration) + populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } @@ -6680,6 +7813,9 @@ func (s *SubscriptionUpdateParametersProperties) UnmarshalJSON(data []byte) erro case "filtersConfiguration": err = unpopulate(val, "FiltersConfiguration", &s.FiltersConfiguration) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -6925,11 +8061,14 @@ func (s *SystemTopicsListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Topic. func (t Topic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "extendedLocation", t.ExtendedLocation) populate(objectMap, "id", t.ID) populate(objectMap, "identity", t.Identity) + populate(objectMap, "kind", t.Kind) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) + populate(objectMap, "sku", t.SKU) populate(objectMap, "systemData", t.SystemData) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) @@ -6945,12 +8084,18 @@ func (t *Topic) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &t.ExtendedLocation) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &t.Identity) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &t.Kind) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) @@ -6960,6 +8105,9 @@ func (t *Topic) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &t.SKU) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) @@ -7187,6 +8335,7 @@ func (t *TopicSpaceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopicSpacesConfiguration. func (t TopicSpacesConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "clientAuthentication", t.ClientAuthentication) populate(objectMap, "customDomains", t.CustomDomains) populate(objectMap, "hostname", t.Hostname) populate(objectMap, "maximumClientSessionsPerAuthenticationName", t.MaximumClientSessionsPerAuthenticationName) @@ -7207,6 +8356,9 @@ func (t *TopicSpacesConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "clientAuthentication": + err = unpopulate(val, "ClientAuthentication", &t.ClientAuthentication) + delete(rawMsg, key) case "customDomains": err = unpopulate(val, "CustomDomains", &t.CustomDomains) delete(rawMsg, key) @@ -7482,6 +8634,7 @@ func (t TopicUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", t.Identity) populate(objectMap, "properties", t.Properties) + populate(objectMap, "sku", t.SKU) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } @@ -7501,6 +8654,9 @@ func (t *TopicUpdateParameters) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &t.SKU) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) @@ -7620,6 +8776,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateTopicSpacesConfigurationInfo. func (u UpdateTopicSpacesConfigurationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "clientAuthentication", u.ClientAuthentication) populate(objectMap, "customDomains", u.CustomDomains) populate(objectMap, "maximumClientSessionsPerAuthenticationName", u.MaximumClientSessionsPerAuthenticationName) populate(objectMap, "maximumSessionExpiryInHours", u.MaximumSessionExpiryInHours) @@ -7639,6 +8796,9 @@ func (u *UpdateTopicSpacesConfigurationInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "clientAuthentication": + err = unpopulate(val, "ClientAuthentication", &u.ClientAuthentication) + delete(rawMsg, key) case "customDomains": err = unpopulate(val, "CustomDomains", &u.CustomDomains) delete(rawMsg, key) @@ -7773,6 +8933,7 @@ func (v *VerifiedPartner) UnmarshalJSON(data []byte) error { func (v VerifiedPartnerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "organizationName", v.OrganizationName) + populate(objectMap, "partnerDestinationDetails", v.PartnerDestinationDetails) populate(objectMap, "partnerDisplayName", v.PartnerDisplayName) populate(objectMap, "partnerRegistrationImmutableId", v.PartnerRegistrationImmutableID) populate(objectMap, "partnerTopicDetails", v.PartnerTopicDetails) @@ -7792,6 +8953,9 @@ func (v *VerifiedPartnerProperties) UnmarshalJSON(data []byte) error { case "organizationName": err = unpopulate(val, "OrganizationName", &v.OrganizationName) delete(rawMsg, key) + case "partnerDestinationDetails": + err = unpopulate(val, "PartnerDestinationDetails", &v.PartnerDestinationDetails) + delete(rawMsg, key) case "partnerDisplayName": err = unpopulate(val, "PartnerDisplayName", &v.PartnerDisplayName) delete(rawMsg, key) @@ -7929,6 +9093,166 @@ func (w *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(data []byt return nil } +// MarshalJSON implements the json.Marshaller interface for type WebhookAuthenticationSettings. +func (w WebhookAuthenticationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureActiveDirectoryApplicationIdOrUri", w.AzureActiveDirectoryApplicationIDOrURI) + populate(objectMap, "azureActiveDirectoryTenantId", w.AzureActiveDirectoryTenantID) + populate(objectMap, "endpointBaseUrl", w.EndpointBaseURL) + populate(objectMap, "endpointUrl", w.EndpointURL) + populate(objectMap, "identity", w.Identity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookAuthenticationSettings. +func (w *WebhookAuthenticationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureActiveDirectoryApplicationIdOrUri": + err = unpopulate(val, "AzureActiveDirectoryApplicationIDOrURI", &w.AzureActiveDirectoryApplicationIDOrURI) + delete(rawMsg, key) + case "azureActiveDirectoryTenantId": + err = unpopulate(val, "AzureActiveDirectoryTenantID", &w.AzureActiveDirectoryTenantID) + delete(rawMsg, key) + case "endpointBaseUrl": + err = unpopulate(val, "EndpointBaseURL", &w.EndpointBaseURL) + delete(rawMsg, key) + case "endpointUrl": + err = unpopulate(val, "EndpointURL", &w.EndpointURL) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &w.Identity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebhookPartnerDestinationInfo. +func (w WebhookPartnerDestinationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureSubscriptionId", w.AzureSubscriptionID) + populate(objectMap, "endpointServiceContext", w.EndpointServiceContext) + objectMap["endpointType"] = PartnerEndpointTypeWebHook + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "resourceGroupName", w.ResourceGroupName) + populate(objectMap, "resourceMoveChangeHistory", w.ResourceMoveChangeHistory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPartnerDestinationInfo. +func (w *WebhookPartnerDestinationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureSubscriptionId": + err = unpopulate(val, "AzureSubscriptionID", &w.AzureSubscriptionID) + delete(rawMsg, key) + case "endpointServiceContext": + err = unpopulate(val, "EndpointServiceContext", &w.EndpointServiceContext) + delete(rawMsg, key) + case "endpointType": + err = unpopulate(val, "EndpointType", &w.EndpointType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &w.ResourceGroupName) + delete(rawMsg, key) + case "resourceMoveChangeHistory": + err = unpopulate(val, "ResourceMoveChangeHistory", &w.ResourceMoveChangeHistory) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebhookPartnerDestinationProperties. +func (w WebhookPartnerDestinationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientAuthentication", w.ClientAuthentication) + populate(objectMap, "endpointBaseUrl", w.EndpointBaseURL) + populate(objectMap, "endpointUrl", w.EndpointURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPartnerDestinationProperties. +func (w *WebhookPartnerDestinationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAuthentication": + w.ClientAuthentication, err = unmarshalPartnerClientAuthenticationClassification(val) + delete(rawMsg, key) + case "endpointBaseUrl": + err = unpopulate(val, "EndpointBaseURL", &w.EndpointBaseURL) + delete(rawMsg, key) + case "endpointUrl": + err = unpopulate(val, "EndpointURL", &w.EndpointURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebhookUpdatePartnerDestinationInfo. +func (w WebhookUpdatePartnerDestinationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["endpointType"] = PartnerEndpointTypeWebHook + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookUpdatePartnerDestinationInfo. +func (w *WebhookUpdatePartnerDestinationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &w.EndpointType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client.go index a48d94c0ff1f..0278e441d634 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client.go @@ -45,7 +45,7 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Asynchronously creates or updates a new namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - namespaceInfo - Namespace information. @@ -72,7 +72,7 @@ func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Asynchronously creates or updates a new namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, namespaceInfo Namespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginCreateOrUpdate" @@ -114,7 +114,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, namespaceInfo); err != nil { @@ -126,7 +126,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete existing namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. @@ -151,7 +151,7 @@ func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete existing namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginDelete" @@ -193,7 +193,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get properties of a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - NamespacesClientGetOptions contains the optional parameters for the NamespacesClient.Get method. @@ -248,7 +248,7 @@ func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ func (client *NamespacesClient) getHandleResponse(resp *http.Response) (Namespac // NewListByResourceGroupPager - List all the namespaces under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.NewListByResourceGroupPager // method. @@ -314,7 +314,7 @@ func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Con if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *NamespacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List all the namespaces under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - NamespacesClientListBySubscriptionOptions contains the optional parameters for the NamespacesClient.NewListBySubscriptionPager // method. func (client *NamespacesClient) NewListBySubscriptionPager(options *NamespacesClientListBySubscriptionOptions) *runtime.Pager[NamespacesClientListBySubscriptionResponse] { @@ -375,7 +375,7 @@ func (client *NamespacesClient) listBySubscriptionCreateRequest(ctx context.Cont if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +393,7 @@ func (client *NamespacesClient) listBySubscriptionHandleResponse(resp *http.Resp // ListSharedAccessKeys - List the two keys used to publish to a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - NamespacesClientListSharedAccessKeysOptions contains the optional parameters for the NamespacesClient.ListSharedAccessKeys @@ -440,7 +440,7 @@ func (client *NamespacesClient) listSharedAccessKeysCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -458,7 +458,7 @@ func (client *NamespacesClient) listSharedAccessKeysHandleResponse(resp *http.Re // BeginRegenerateKey - Regenerate a shared access key for a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the Namespace. // - regenerateKeyRequest - Request body to regenerate key. @@ -485,7 +485,7 @@ func (client *NamespacesClient) BeginRegenerateKey(ctx context.Context, resource // RegenerateKey - Regenerate a shared access key for a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespacesClient) regenerateKey(ctx context.Context, resourceGroupName string, namespaceName string, regenerateKeyRequest NamespaceRegenerateKeyRequest, options *NamespacesClientBeginRegenerateKeyOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginRegenerateKey" @@ -527,7 +527,7 @@ func (client *NamespacesClient) regenerateKeyCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateKeyRequest); err != nil { @@ -539,7 +539,7 @@ func (client *NamespacesClient) regenerateKeyCreateRequest(ctx context.Context, // BeginUpdate - Asynchronously updates a namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - namespaceUpdateParameters - Namespace update information. @@ -565,7 +565,7 @@ func (client *NamespacesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Asynchronously updates a namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespacesClient) update(ctx context.Context, resourceGroupName string, namespaceName string, namespaceUpdateParameters NamespaceUpdateParameters, options *NamespacesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginUpdate" @@ -607,7 +607,7 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, namespaceUpdateParameters); err != nil { @@ -620,7 +620,7 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc // namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the Namespace. // - options - NamespacesClientBeginValidateCustomDomainOwnershipOptions contains the optional parameters for the NamespacesClient.BeginValidateCustomDomainOwnership @@ -646,7 +646,7 @@ func (client *NamespacesClient) BeginValidateCustomDomainOwnership(ctx context.C // ValidateCustomDomainOwnership - Performs ownership validation via checking TXT records for all custom domains in a namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespacesClient) validateCustomDomainOwnership(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginValidateCustomDomainOwnershipOptions) (*http.Response, error) { var err error const operationName = "NamespacesClient.BeginValidateCustomDomainOwnership" @@ -688,7 +688,7 @@ func (client *NamespacesClient) validateCustomDomainOwnershipCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client_example_test.go deleted file mode 100644 index 0b11612839d4..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client_example_test.go +++ /dev/null @@ -1,374 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Get.json -func ExampleNamespacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().Get(ctx, "examplerg", "exampleNamespaceName1", 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.Namespace = armeventgrid.Namespace{ - // Name: to.Ptr("exampleNamespaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // "key3": to.Ptr("value3"), - // }, - // Properties: &armeventgrid.NamespaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.NamespaceProvisioningStateSucceeded), - // TopicSpacesConfiguration: &armeventgrid.TopicSpacesConfiguration{ - // Hostname: to.Ptr("exampleNamespaceName1.westus-1.mqtt.eventgrid-int.azure.net"), - // RouteTopicResourceID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // State: to.Ptr(armeventgrid.TopicSpacesConfigurationStateEnabled), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_CreateOrUpdate.json -func ExampleNamespacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleNamespaceName1", armeventgrid.Namespace{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value11"), - "tag2": to.Ptr("value22"), - }, - Properties: &armeventgrid.NamespaceProperties{ - TopicSpacesConfiguration: &armeventgrid.TopicSpacesConfiguration{ - RouteTopicResourceID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - State: to.Ptr(armeventgrid.TopicSpacesConfigurationStateEnabled), - }, - }, - }, 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.Namespace = armeventgrid.Namespace{ - // Name: to.Ptr("exampleNamespaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/Namespaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value11"), - // "key2": to.Ptr("value22"), - // }, - // Properties: &armeventgrid.NamespaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.NamespaceProvisioningStateSucceeded), - // TopicSpacesConfiguration: &armeventgrid.TopicSpacesConfiguration{ - // RouteTopicResourceID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // State: to.Ptr(armeventgrid.TopicSpacesConfigurationStateEnabled), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Delete.json -func ExampleNamespacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().BeginDelete(ctx, "examplerg", "exampleNamespaceName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Update.json -func ExampleNamespacesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().BeginUpdate(ctx, "examplerg", "exampleNamespaceName1", armeventgrid.NamespaceUpdateParameters{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1Updated"), - }, - }, 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.Namespace = armeventgrid.Namespace{ - // Name: to.Ptr("exampleNamespaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1"), - // Location: to.Ptr("westus"), - // Properties: &armeventgrid.NamespaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.NamespaceProvisioningStateSucceeded), - // TopicSpacesConfiguration: &armeventgrid.TopicSpacesConfiguration{ - // Hostname: to.Ptr("exampleNamespaceName1.westus-1.mqtt.eventgrid-int.azure.net"), - // RouteTopicResourceID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // State: to.Ptr(armeventgrid.TopicSpacesConfigurationStateEnabled), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_ListBySubscription.json -func ExampleNamespacesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListBySubscriptionPager(&armeventgrid.NamespacesClientListBySubscriptionOptions{Filter: nil, - Top: 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.NamespacesListResult = armeventgrid.NamespacesListResult{ - // Value: []*armeventgrid.Namespace{ - // { - // Name: to.Ptr("exampleNamespaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // "key3": to.Ptr("value3"), - // }, - // Properties: &armeventgrid.NamespaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.NamespaceProvisioningStateSucceeded), - // TopicSpacesConfiguration: &armeventgrid.TopicSpacesConfiguration{ - // Hostname: to.Ptr("exampleNamespaceName1.westus-1.mqtt.eventgrid-int.azure.net"), - // RouteTopicResourceID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // State: to.Ptr(armeventgrid.TopicSpacesConfigurationStateEnabled), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_ListByResourceGroup.json -func ExampleNamespacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespacesClient().NewListByResourceGroupPager("examplerg", &armeventgrid.NamespacesClientListByResourceGroupOptions{Filter: nil, - Top: 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.NamespacesListResult = armeventgrid.NamespacesListResult{ - // Value: []*armeventgrid.Namespace{ - // { - // Name: to.Ptr("exampleNamespaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // "key3": to.Ptr("value3"), - // }, - // Properties: &armeventgrid.NamespaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.NamespaceProvisioningStateSucceeded), - // TopicSpacesConfiguration: &armeventgrid.TopicSpacesConfiguration{ - // Hostname: to.Ptr("exampleNamespaceName1.westus-1.mqtt.eventgrid-int.azure.net"), - // RouteTopicResourceID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // State: to.Ptr(armeventgrid.TopicSpacesConfigurationStateEnabled), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_ListSharedAccessKeys.json -func ExampleNamespacesClient_ListSharedAccessKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().ListSharedAccessKeys(ctx, "examplerg", "exampleNamespaceName1", 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.NamespaceSharedAccessKeys = armeventgrid.NamespaceSharedAccessKeys{ - // Key1: to.Ptr("testKey1Value"), - // Key2: to.Ptr("testKey2Value"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_RegenerateKey.json -func ExampleNamespacesClient_BeginRegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().BeginRegenerateKey(ctx, "examplerg", "exampleNamespaceName1", armeventgrid.NamespaceRegenerateKeyRequest{ - KeyName: to.Ptr("key1"), - }, 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.NamespaceSharedAccessKeys = armeventgrid.NamespaceSharedAccessKeys{ - // Key1: to.Ptr("testKey1Value"), - // Key2: to.Ptr("testKey2Value"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_ValidateCustomDomainOwnership.json -func ExampleNamespacesClient_BeginValidateCustomDomainOwnership() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespacesClient().BeginValidateCustomDomainOwnership(ctx, "examplerg", "exampleNamespaceName1", 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.CustomDomainOwnershipValidationResult = armeventgrid.CustomDomainOwnershipValidationResult{ - // CustomDomainsForTopicSpacesConfiguration: []*armeventgrid.CustomDomainConfiguration{ - // { - // CertificateURL: to.Ptr("string"), - // ExpectedTxtRecordName: to.Ptr("txt-record-name-2"), - // ExpectedTxtRecordValue: to.Ptr("txt-record-value-2"), - // FullyQualifiedDomainName: to.Ptr("custom-domain-name-2"), - // Identity: &armeventgrid.CustomDomainIdentity{ - // Type: to.Ptr(armeventgrid.CustomDomainIdentityTypeSystemAssigned), - // }, - // ValidationState: to.Ptr(armeventgrid.CustomDomainValidationStatePending), - // }}, - // CustomDomainsForTopicsConfiguration: []*armeventgrid.CustomDomainConfiguration{ - // { - // CertificateURL: to.Ptr("string"), - // ExpectedTxtRecordName: to.Ptr("txt-record-name-1"), - // ExpectedTxtRecordValue: to.Ptr("txt-record-value-1"), - // FullyQualifiedDomainName: to.Ptr("custom-domain-name-1"), - // Identity: &armeventgrid.CustomDomainIdentity{ - // Type: to.Ptr(armeventgrid.CustomDomainIdentityTypeSystemAssigned), - // }, - // ValidationState: to.Ptr(armeventgrid.CustomDomainValidationStatePending), - // }}, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client.go index b668df6d5498..8ddb0368558e 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client.go @@ -46,7 +46,7 @@ func NewNamespaceTopicEventSubscriptionsClient(subscriptionID string, credential // Existing event subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -77,7 +77,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx co // Existing event subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespaceTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo Subscription, options *NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NamespaceTopicEventSubscriptionsClient.BeginCreateOrUpdate" @@ -127,7 +127,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionInfo); err != nil { @@ -139,7 +139,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) createOrUpdateCreateReques // BeginDelete - Delete an existing event subscription of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -167,7 +167,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) BeginDelete(ctx context.Co // Delete - Delete an existing event subscription of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespaceTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, options *NamespaceTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NamespaceTopicEventSubscriptionsClient.BeginDelete" @@ -217,7 +217,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +226,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) deleteCreateRequest(ctx co // Get - Get properties of an event subscription of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -283,7 +283,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +301,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) getHandleResponse(resp *ht // GetDeliveryAttributes - Get all delivery attributes for an event subscription of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -358,7 +358,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) getDeliveryAttributesCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -376,7 +376,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) getDeliveryAttributesHandl // GetFullURL - Get the full endpoint URL for an event subscription of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -433,7 +433,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) getFullURLCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -450,7 +450,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) getFullURLHandleResponse(r // NewListByNamespaceTopicPager - List event subscriptions that belong to a specific namespace topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -509,7 +509,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) listByNamespaceTopicCreate if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -527,7 +527,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) listByNamespaceTopicHandle // BeginUpdate - Update an existing event subscription of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -556,7 +556,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) BeginUpdate(ctx context.Co // Update - Update an existing event subscription of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespaceTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters SubscriptionUpdateParameters, options *NamespaceTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "NamespaceTopicEventSubscriptionsClient.BeginUpdate" @@ -606,7 +606,7 @@ func (client *NamespaceTopicEventSubscriptionsClient) updateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client_example_test.go deleted file mode 100644 index 85cfba7137c2..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client_example_test.go +++ /dev/null @@ -1,316 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopicEventSubscriptions_Get.json -func ExampleNamespaceTopicEventSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespaceTopicEventSubscriptionsClient().Get(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", "examplenamespacetopicEventSub1", 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.Subscription = armeventgrid.Subscription{ - // Name: to.Ptr("examplenamespacetopicEventSub2"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics/eventsubscriptions"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic2/eventSubscriptions/examplenamespacetopicEventSub2"), - // Properties: &armeventgrid.SubscriptionProperties{ - // DeliveryConfiguration: &armeventgrid.DeliveryConfiguration{ - // DeliveryMode: to.Ptr(armeventgrid.DeliveryModeQueue), - // Queue: &armeventgrid.QueueInfo{ - // EventTimeToLive: to.Ptr("P1D"), - // MaxDeliveryCount: to.Ptr[int32](4), - // ReceiveLockDurationInSeconds: to.Ptr[int32](60), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.DeliverySchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.SubscriptionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopicEventSubscriptions_CreateOrUpdate.json -func ExampleNamespaceTopicEventSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespaceTopicEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", "examplenamespacetopicEventSub2", armeventgrid.Subscription{ - Properties: &armeventgrid.SubscriptionProperties{ - DeliveryConfiguration: &armeventgrid.DeliveryConfiguration{ - DeliveryMode: to.Ptr(armeventgrid.DeliveryModeQueue), - Queue: &armeventgrid.QueueInfo{ - EventTimeToLive: to.Ptr("P1D"), - MaxDeliveryCount: to.Ptr[int32](4), - ReceiveLockDurationInSeconds: to.Ptr[int32](60), - }, - }, - EventDeliverySchema: to.Ptr(armeventgrid.DeliverySchemaCloudEventSchemaV10), - }, - }, 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.Subscription = armeventgrid.Subscription{ - // Name: to.Ptr("examplenamespacetopicEventSub2"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics/eventsubscriptions"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic2/eventSubscriptions/examplenamespacetopicEventSub2"), - // Properties: &armeventgrid.SubscriptionProperties{ - // DeliveryConfiguration: &armeventgrid.DeliveryConfiguration{ - // DeliveryMode: to.Ptr(armeventgrid.DeliveryModeQueue), - // Queue: &armeventgrid.QueueInfo{ - // EventTimeToLive: to.Ptr("P1D"), - // MaxDeliveryCount: to.Ptr[int32](4), - // ReceiveLockDurationInSeconds: to.Ptr[int32](60), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.DeliverySchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.SubscriptionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopicEventSubscriptions_Delete.json -func ExampleNamespaceTopicEventSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespaceTopicEventSubscriptionsClient().BeginDelete(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", "examplenamespacetopicEventSub2", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopicEventSubscriptions_Update.json -func ExampleNamespaceTopicEventSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespaceTopicEventSubscriptionsClient().BeginUpdate(ctx, "examplerg", "exampleNamespaceName1", "exampleNamespaceTopicName1", "exampleNamespaceTopicEventSubscriptionName1", armeventgrid.SubscriptionUpdateParameters{ - Properties: &armeventgrid.SubscriptionUpdateParametersProperties{ - DeliveryConfiguration: &armeventgrid.DeliveryConfiguration{ - DeliveryMode: to.Ptr(armeventgrid.DeliveryModeQueue), - Queue: &armeventgrid.QueueInfo{ - EventTimeToLive: to.Ptr("P1D"), - MaxDeliveryCount: to.Ptr[int32](3), - ReceiveLockDurationInSeconds: to.Ptr[int32](60), - }, - }, - EventDeliverySchema: to.Ptr(armeventgrid.DeliverySchemaCloudEventSchemaV10), - }, - }, 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.Subscription = armeventgrid.Subscription{ - // Name: to.Ptr("exampleNamespaceTopicEventSubscriptionName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics/eventsubscriptions"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/exampleNamespaceTopicName1/eventSubscriptions/exampleNamespaceTopicEventSubscriptionName1"), - // Properties: &armeventgrid.SubscriptionProperties{ - // DeliveryConfiguration: &armeventgrid.DeliveryConfiguration{ - // DeliveryMode: to.Ptr(armeventgrid.DeliveryModeQueue), - // Queue: &armeventgrid.QueueInfo{ - // EventTimeToLive: to.Ptr("P1D"), - // MaxDeliveryCount: to.Ptr[int32](3), - // ReceiveLockDurationInSeconds: to.Ptr[int32](60), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.DeliverySchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.SubscriptionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopicEventSubscriptions_ListByNamespaceTopic.json -func ExampleNamespaceTopicEventSubscriptionsClient_NewListByNamespaceTopicPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespaceTopicEventSubscriptionsClient().NewListByNamespaceTopicPager("examplerg", "examplenamespace2", "examplenamespacetopic2", &armeventgrid.NamespaceTopicEventSubscriptionsClientListByNamespaceTopicOptions{Filter: nil, - Top: 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.SubscriptionsListResult = armeventgrid.SubscriptionsListResult{ - // Value: []*armeventgrid.Subscription{ - // { - // Name: to.Ptr("examplenamespacetopicEventSub1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics/eventsubscriptions"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic2/eventSubscriptions/examplenamespacetopicEventSub1"), - // Properties: &armeventgrid.SubscriptionProperties{ - // DeliveryConfiguration: &armeventgrid.DeliveryConfiguration{ - // DeliveryMode: to.Ptr(armeventgrid.DeliveryModeQueue), - // Queue: &armeventgrid.QueueInfo{ - // EventTimeToLive: to.Ptr("P1D"), - // MaxDeliveryCount: to.Ptr[int32](5), - // ReceiveLockDurationInSeconds: to.Ptr[int32](50), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.DeliverySchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.SubscriptionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("examplenamespacetopicEventSub2"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics/eventsubscriptions"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic2/eventSubscriptions/examplenamespacetopicEventSub2"), - // Properties: &armeventgrid.SubscriptionProperties{ - // DeliveryConfiguration: &armeventgrid.DeliveryConfiguration{ - // DeliveryMode: to.Ptr(armeventgrid.DeliveryModeQueue), - // Queue: &armeventgrid.QueueInfo{ - // EventTimeToLive: to.Ptr("P1D"), - // MaxDeliveryCount: to.Ptr[int32](4), - // ReceiveLockDurationInSeconds: to.Ptr[int32](60), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.DeliverySchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.SubscriptionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopicEventSubscriptions_GetDeliveryAttributes.json -func ExampleNamespaceTopicEventSubscriptionsClient_GetDeliveryAttributes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespaceTopicEventSubscriptionsClient().GetDeliveryAttributes(ctx, "examplerg", "exampleNamespace", "exampleNamespaceTopic", "exampleEventSubscriptionName", 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.DeliveryAttributeListResult = armeventgrid.DeliveryAttributeListResult{ - // Value: []armeventgrid.DeliveryAttributeMappingClassification{ - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header1"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(false), - // Value: to.Ptr("NormalValue"), - // }, - // }, - // &armeventgrid.DynamicDeliveryAttributeMapping{ - // Name: to.Ptr("header2"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeDynamic), - // Properties: &armeventgrid.DynamicDeliveryAttributeMappingProperties{ - // SourceField: to.Ptr("data.foo"), - // }, - // }, - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header3"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(true), - // Value: to.Ptr("mySecretValue"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopicEventSubscriptions_GetFullUrl.json -func ExampleNamespaceTopicEventSubscriptionsClient_GetFullURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespaceTopicEventSubscriptionsClient().GetFullURL(ctx, "examplerg", "exampleNamespaceName1", "exampleDomainTopic1", "examplesubscription1", 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.SubscriptionFullURL = armeventgrid.SubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client.go index f4399147d782..01da117c90fc 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client.go @@ -45,7 +45,7 @@ func NewNamespaceTopicsClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Asynchronously creates a new namespace topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -73,7 +73,7 @@ func (client *NamespaceTopicsClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Asynchronously creates a new namespace topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespaceTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicInfo NamespaceTopic, options *NamespaceTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NamespaceTopicsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *NamespaceTopicsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, namespaceTopicInfo); err != nil { @@ -131,7 +131,7 @@ func (client *NamespaceTopicsClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete existing namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the topic. @@ -158,7 +158,7 @@ func (client *NamespaceTopicsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete existing namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespaceTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NamespaceTopicsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *NamespaceTopicsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *NamespaceTopicsClient) deleteCreateRequest(ctx context.Context, re // Get - Get properties of a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -264,7 +264,7 @@ func (client *NamespaceTopicsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *NamespaceTopicsClient) getHandleResponse(resp *http.Response) (Nam // NewListByNamespacePager - List all the namespace topics under a namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - NamespaceTopicsClientListByNamespaceOptions contains the optional parameters for the NamespaceTopicsClient.NewListByNamespacePager @@ -335,7 +335,7 @@ func (client *NamespaceTopicsClient) listByNamespaceCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +353,7 @@ func (client *NamespaceTopicsClient) listByNamespaceHandleResponse(resp *http.Re // ListSharedAccessKeys - List the two keys used to publish to a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the topic. @@ -405,7 +405,7 @@ func (client *NamespaceTopicsClient) listSharedAccessKeysCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,7 +423,7 @@ func (client *NamespaceTopicsClient) listSharedAccessKeysHandleResponse(resp *ht // BeginRegenerateKey - Regenerate a shared access key for a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the topic. @@ -451,7 +451,7 @@ func (client *NamespaceTopicsClient) BeginRegenerateKey(ctx context.Context, res // RegenerateKey - Regenerate a shared access key for a namespace topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespaceTopicsClient) regenerateKey(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest, options *NamespaceTopicsClientBeginRegenerateKeyOptions) (*http.Response, error) { var err error const operationName = "NamespaceTopicsClient.BeginRegenerateKey" @@ -497,7 +497,7 @@ func (client *NamespaceTopicsClient) regenerateKeyCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateKeyRequest); err != nil { @@ -509,7 +509,7 @@ func (client *NamespaceTopicsClient) regenerateKeyCreateRequest(ctx context.Cont // BeginUpdate - Asynchronously updates a namespace topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicName - Name of the namespace topic. @@ -537,7 +537,7 @@ func (client *NamespaceTopicsClient) BeginUpdate(ctx context.Context, resourceGr // Update - Asynchronously updates a namespace topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *NamespaceTopicsClient) update(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicUpdateParameters NamespaceTopicUpdateParameters, options *NamespaceTopicsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "NamespaceTopicsClient.BeginUpdate" @@ -583,7 +583,7 @@ func (client *NamespaceTopicsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, namespaceTopicUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client_example_test.go deleted file mode 100644 index e3209da549ab..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client_example_test.go +++ /dev/null @@ -1,257 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Get.json -func ExampleNamespaceTopicsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespaceTopicsClient().Get(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", 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.NamespaceTopic = armeventgrid.NamespaceTopic{ - // Name: to.Ptr("examplenamespacetopic2"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e41/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic2"), - // Properties: &armeventgrid.NamespaceTopicProperties{ - // EventRetentionInDays: to.Ptr[int32](1), - // InputSchema: to.Ptr(armeventgrid.EventInputSchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.NamespaceTopicProvisioningStateSucceeded), - // PublisherType: to.Ptr(armeventgrid.PublisherTypeCustom), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_CreateOrUpdate.json -func ExampleNamespaceTopicsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespaceTopicsClient().BeginCreateOrUpdate(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", armeventgrid.NamespaceTopic{ - Properties: &armeventgrid.NamespaceTopicProperties{ - EventRetentionInDays: to.Ptr[int32](1), - InputSchema: to.Ptr(armeventgrid.EventInputSchemaCloudEventSchemaV10), - PublisherType: to.Ptr(armeventgrid.PublisherTypeCustom), - }, - }, 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.NamespaceTopic = armeventgrid.NamespaceTopic{ - // Name: to.Ptr("examplenamespacetopic2"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic2"), - // Properties: &armeventgrid.NamespaceTopicProperties{ - // EventRetentionInDays: to.Ptr[int32](1), - // InputSchema: to.Ptr(armeventgrid.EventInputSchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.NamespaceTopicProvisioningStateSucceeded), - // PublisherType: to.Ptr(armeventgrid.PublisherTypeCustom), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Delete.json -func ExampleNamespaceTopicsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespaceTopicsClient().BeginDelete(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Update.json -func ExampleNamespaceTopicsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespaceTopicsClient().BeginUpdate(ctx, "examplerg", "exampleNamespaceName1", "exampleNamespaceTopicName1", armeventgrid.NamespaceTopicUpdateParameters{ - Properties: &armeventgrid.NamespaceTopicUpdateParameterProperties{ - EventRetentionInDays: to.Ptr[int32](1), - }, - }, 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.NamespaceTopic = armeventgrid.NamespaceTopic{ - // Name: to.Ptr("examplenamespacetopic2"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/topics/exampleNamespaceTopicName1"), - // Properties: &armeventgrid.NamespaceTopicProperties{ - // EventRetentionInDays: to.Ptr[int32](1), - // InputSchema: to.Ptr(armeventgrid.EventInputSchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.NamespaceTopicProvisioningStateSucceeded), - // PublisherType: to.Ptr(armeventgrid.PublisherTypeCustom), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_ListByNamespace.json -func ExampleNamespaceTopicsClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNamespaceTopicsClient().NewListByNamespacePager("examplerg", "examplenamespace2", &armeventgrid.NamespaceTopicsClientListByNamespaceOptions{Filter: nil, - Top: 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.NamespaceTopicsListResult = armeventgrid.NamespaceTopicsListResult{ - // Value: []*armeventgrid.NamespaceTopic{ - // { - // Name: to.Ptr("examplenamespacetopic2"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic2"), - // Properties: &armeventgrid.NamespaceTopicProperties{ - // EventRetentionInDays: to.Ptr[int32](1), - // InputSchema: to.Ptr(armeventgrid.EventInputSchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.NamespaceTopicProvisioningStateSucceeded), - // PublisherType: to.Ptr(armeventgrid.PublisherTypeCustom), - // }, - // }, - // { - // Name: to.Ptr("examplenamespacetopic4"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topics"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/examplenamespace2/topics/examplenamespacetopic4"), - // Properties: &armeventgrid.NamespaceTopicProperties{ - // EventRetentionInDays: to.Ptr[int32](1), - // InputSchema: to.Ptr(armeventgrid.EventInputSchemaCloudEventSchemaV10), - // ProvisioningState: to.Ptr(armeventgrid.NamespaceTopicProvisioningStateSucceeded), - // PublisherType: to.Ptr(armeventgrid.PublisherTypeCustom), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_ListSharedAccessKeys.json -func ExampleNamespaceTopicsClient_ListSharedAccessKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespaceTopicsClient().ListSharedAccessKeys(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", 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.TopicSharedAccessKeys = armeventgrid.TopicSharedAccessKeys{ - // Key1: to.Ptr("testKey1Value"), - // Key2: to.Ptr("testKey2Value"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_RegenerateKey.json -func ExampleNamespaceTopicsClient_BeginRegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNamespaceTopicsClient().BeginRegenerateKey(ctx, "examplerg", "examplenamespace2", "examplenamespacetopic2", armeventgrid.TopicRegenerateKeyRequest{ - KeyName: to.Ptr("key1"), - }, 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.TopicSharedAccessKeys = armeventgrid.TopicSharedAccessKeys{ - // Key1: to.Ptr("testKey1Value"), - // Key2: to.Ptr("testKey2Value"), - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..804386d2d6b3 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,287 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armeventgrid + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationsClient contains the methods for the NetworkSecurityPerimeterConfigurations group. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead. +type NetworkSecurityPerimeterConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get a specific network security perimeter configuration with a topic or domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - resourceType - The type of the resource. This can be either \'topics\', or \'domains\'. +// - resourceName - The name of the resource (namely, either, the topic name or domain name). +// - perimeterGUID - Unique identifier for perimeter +// - associationName - Association name to association network security perimeter resource to profile +// - options - NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceType NetworkSecurityPerimeterResourceType, resourceName string, perimeterGUID string, associationName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceType, resourceName, perimeterGUID, associationName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceType NetworkSecurityPerimeterResourceType, resourceName string, perimeterGUID string, associationName string, _ *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{resourceType}/{resourceName}/networkSecurityPerimeterConfigurations/{perimeterGuid}.{associationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceType == "" { + return nil, errors.New("parameter resourceType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(string(resourceType))) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if perimeterGUID == "" { + return nil, errors.New("parameter perimeterGUID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{perimeterGuid}", url.PathEscape(perimeterGUID)) + if associationName == "" { + return nil, errors.New("parameter associationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{associationName}", url.PathEscape(associationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get all network security perimeter configurations associated with a topic or domain. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - resourceType - The type of the resource. This can be either \'topics\' or \'domains\'. +// - resourceName - The name of the resource (namely, either, the topic name or domain name). +// - options - NetworkSecurityPerimeterConfigurationsClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListPager +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) NewListPager(resourceGroupName string, resourceType NetworkSecurityPerimeterResourceType, resourceName string, options *NetworkSecurityPerimeterConfigurationsClientListOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkSecurityPerimeterConfigurationsClientListResponse]{ + More: func(page NetworkSecurityPerimeterConfigurationsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *NetworkSecurityPerimeterConfigurationsClientListResponse) (NetworkSecurityPerimeterConfigurationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkSecurityPerimeterConfigurationsClient.NewListPager") + req, err := client.listCreateRequest(ctx, resourceGroupName, resourceType, resourceName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceType NetworkSecurityPerimeterResourceType, resourceName string, _ *NetworkSecurityPerimeterConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{resourceType}/{resourceName}/networkSecurityPerimeterConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceType == "" { + return nil, errors.New("parameter resourceType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(string(resourceType))) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *NetworkSecurityPerimeterConfigurationsClient) listHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientListResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationList); err != nil { + return NetworkSecurityPerimeterConfigurationsClientListResponse{}, err + } + return result, nil +} + +// BeginReconcile - Reconcile a specific network security perimeter configuration for a given network security perimeter association +// with a topic or domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - resourceType - The type of the resource. This can be either \'topics\' or \'domains\'. +// - resourceName - The name of the resource (namely, either, the topic name or domain name). +// - perimeterGUID - Unique identifier for perimeter +// - associationName - Association name to association network security perimeter resource to profile +// - options - NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx context.Context, resourceGroupName string, resourceType NetworkSecurityPerimeterResourceType, resourceName string, perimeterGUID string, associationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reconcile(ctx, resourceGroupName, resourceType, resourceName, perimeterGUID, associationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Reconcile - Reconcile a specific network security perimeter configuration for a given network security perimeter association +// with a topic or domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, resourceType NetworkSecurityPerimeterResourceType, resourceName string, perimeterGUID string, associationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reconcileCreateRequest(ctx, resourceGroupName, resourceType, resourceName, perimeterGUID, associationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// reconcileCreateRequest creates the Reconcile request. +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, resourceType NetworkSecurityPerimeterResourceType, resourceName string, perimeterGUID string, associationName string, _ *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{resourceType}/{resourceName}/networkSecurityPerimeterConfigurations/{perimeterGuid}.{associationName}/reconcile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceType == "" { + return nil, errors.New("parameter resourceType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(string(resourceType))) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if perimeterGUID == "" { + return nil, errors.New("parameter perimeterGUID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{perimeterGuid}", url.PathEscape(perimeterGUID)) + if associationName == "" { + return nil, errors.New("parameter associationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{associationName}", url.PathEscape(associationName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go index 081238750e76..3373f05b3756 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go @@ -36,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the available operations supported by the Microsoft.EventGrid resource provider. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -70,7 +70,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/operations_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/operations_client_example_test.go deleted file mode 100644 index e712057f5efd..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/operations_client_example_test.go +++ /dev/null @@ -1,116 +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 armeventgrid_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Operations_List.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 := armeventgrid.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.OperationsListResult = armeventgrid.OperationsListResult{ - // Value: []*armeventgrid.Operation{ - // { - // Name: to.Ptr("Microsoft.EventGrid/register/action"), - // Display: &armeventgrid.OperationInfo{ - // Description: to.Ptr("Registers the eventSubscription for the EventGrid resource provider and enables the creation of Event Grid subscriptions."), - // Operation: to.Ptr("Registers the EventGrid Resource Provider"), - // Provider: to.Ptr("Microsoft Event Grid"), - // Resource: to.Ptr("EventGrid Resource Provider"), - // }, - // Origin: to.Ptr("UserAndSystem"), - // }, - // { - // Name: to.Ptr("Microsoft.EventGrid/eventSubscriptions/write"), - // Display: &armeventgrid.OperationInfo{ - // Description: to.Ptr("Create or update a eventSubscription"), - // Operation: to.Ptr("Write EventSubscription"), - // Provider: to.Ptr("Microsoft Event Grid"), - // Resource: to.Ptr("eventSubscriptions"), - // }, - // Origin: to.Ptr("UserAndSystem"), - // }, - // { - // Name: to.Ptr("Microsoft.EventGrid/eventSubscriptions/read"), - // Display: &armeventgrid.OperationInfo{ - // Description: to.Ptr("Read a eventSubscription"), - // Operation: to.Ptr("Read EventSubscription"), - // Provider: to.Ptr("Microsoft Event Grid"), - // Resource: to.Ptr("eventSubscriptions"), - // }, - // Origin: to.Ptr("UserAndSystem"), - // }, - // { - // Name: to.Ptr("Microsoft.EventGrid/eventSubscriptions/delete"), - // Display: &armeventgrid.OperationInfo{ - // Description: to.Ptr("Delete a eventSubscription"), - // Operation: to.Ptr("Delete EventSubscription"), - // Provider: to.Ptr("Microsoft Event Grid"), - // Resource: to.Ptr("eventSubscriptions"), - // }, - // Origin: to.Ptr("UserAndSystem"), - // }, - // { - // Name: to.Ptr("Microsoft.EventGrid/topics/write"), - // Display: &armeventgrid.OperationInfo{ - // Description: to.Ptr("Create or update a topic"), - // Operation: to.Ptr("Write Topic"), - // Provider: to.Ptr("Microsoft Event Grid"), - // Resource: to.Ptr("topics"), - // }, - // Origin: to.Ptr("UserAndSystem"), - // }, - // { - // Name: to.Ptr("Microsoft.EventGrid/topics/read"), - // Display: &armeventgrid.OperationInfo{ - // Description: to.Ptr("Read a topic"), - // Operation: to.Ptr("Read Topic"), - // Provider: to.Ptr("Microsoft Event Grid"), - // Resource: to.Ptr("topics"), - // }, - // Origin: to.Ptr("UserAndSystem"), - // }, - // { - // Name: to.Ptr("Microsoft.EventGrid/topics/delete"), - // Display: &armeventgrid.OperationInfo{ - // Description: to.Ptr("Delete a topic"), - // Operation: to.Ptr("Delete Topic"), - // Provider: to.Ptr("Microsoft Event Grid"), - // Resource: to.Ptr("topics"), - // }, - // Origin: to.Ptr("UserAndSystem"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/options.go b/sdk/resourcemanager/eventgrid/armeventgrid/options.go index 04371ab88b12..26018a167536 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/options.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/options.go @@ -742,6 +742,25 @@ type NamespacesClientListSharedAccessKeysOptions struct { // placeholder for future optional parameters } +// NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +type NetworkSecurityPerimeterConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListPager +// method. +type NetworkSecurityPerimeterConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -807,6 +826,69 @@ type PartnerConfigurationsClientUnauthorizePartnerOptions struct { // placeholder for future optional parameters } +// PartnerDestinationsClientActivateOptions contains the optional parameters for the PartnerDestinationsClient.Activate method. +type PartnerDestinationsClientActivateOptions struct { + // placeholder for future optional parameters +} + +// PartnerDestinationsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerDestinationsClient.BeginCreateOrUpdate +// method. +type PartnerDestinationsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// PartnerDestinationsClientBeginDeleteOptions contains the optional parameters for the PartnerDestinationsClient.BeginDelete +// method. +type PartnerDestinationsClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// PartnerDestinationsClientBeginUpdateOptions contains the optional parameters for the PartnerDestinationsClient.BeginUpdate +// method. +type PartnerDestinationsClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// PartnerDestinationsClientGetOptions contains the optional parameters for the PartnerDestinationsClient.Get method. +type PartnerDestinationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PartnerDestinationsClientListByResourceGroupOptions contains the optional parameters for the PartnerDestinationsClient.NewListByResourceGroupPager +// method. +type PartnerDestinationsClientListByResourceGroupOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerDestinationsClientListBySubscriptionOptions contains the optional parameters for the PartnerDestinationsClient.NewListBySubscriptionPager +// method. +type PartnerDestinationsClientListBySubscriptionOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + // PartnerNamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerNamespacesClient.BeginCreateOrUpdate // method. type PartnerNamespacesClientBeginCreateOrUpdateOptions struct { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client.go index 4cebda2c46a3..67e5f1de762a 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client.go @@ -45,7 +45,7 @@ func NewPartnerConfigurationsClient(subscriptionID string, credential azcore.Tok // AuthorizePartner - Authorize a single partner either by partner registration immutable Id or by partner name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerInfo - The information of the partner to be authorized. // - options - PartnerConfigurationsClientAuthorizePartnerOptions contains the optional parameters for the PartnerConfigurationsClient.AuthorizePartner @@ -88,7 +88,7 @@ func (client *PartnerConfigurationsClient) authorizePartnerCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerInfo); err != nil { @@ -109,7 +109,7 @@ func (client *PartnerConfigurationsClient) authorizePartnerHandleResponse(resp * // BeginCreateOrUpdate - Synchronously creates or updates a partner configuration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerConfigurationInfo - Partner configuration information. // - options - PartnerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerConfigurationsClient.BeginCreateOrUpdate @@ -134,7 +134,7 @@ func (client *PartnerConfigurationsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Synchronously creates or updates a partner configuration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerConfigurationInfo PartnerConfiguration, options *PartnerConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerConfigurationsClient.BeginCreateOrUpdate" @@ -172,7 +172,7 @@ func (client *PartnerConfigurationsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerConfigurationInfo); err != nil { @@ -184,7 +184,7 @@ func (client *PartnerConfigurationsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete existing partner configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - PartnerConfigurationsClientBeginDeleteOptions contains the optional parameters for the PartnerConfigurationsClient.BeginDelete // method. @@ -208,7 +208,7 @@ func (client *PartnerConfigurationsClient) BeginDelete(ctx context.Context, reso // Delete - Delete existing partner configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PartnerConfigurationsClient.BeginDelete" @@ -246,7 +246,7 @@ func (client *PartnerConfigurationsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -254,7 +254,7 @@ func (client *PartnerConfigurationsClient) deleteCreateRequest(ctx context.Conte // Get - Get properties of a partner configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - PartnerConfigurationsClientGetOptions contains the optional parameters for the PartnerConfigurationsClient.Get // method. @@ -296,7 +296,7 @@ func (client *PartnerConfigurationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,7 +313,7 @@ func (client *PartnerConfigurationsClient) getHandleResponse(resp *http.Response // NewListByResourceGroupPager - List all the partner configurations under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - PartnerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the PartnerConfigurationsClient.NewListByResourceGroupPager // method. @@ -357,7 +357,7 @@ func (client *PartnerConfigurationsClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,7 +374,7 @@ func (client *PartnerConfigurationsClient) listByResourceGroupHandleResponse(res // NewListBySubscriptionPager - List all the partner configurations under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - PartnerConfigurationsClientListBySubscriptionOptions contains the optional parameters for the PartnerConfigurationsClient.NewListBySubscriptionPager // method. func (client *PartnerConfigurationsClient) NewListBySubscriptionPager(options *PartnerConfigurationsClientListBySubscriptionOptions) *runtime.Pager[PartnerConfigurationsClientListBySubscriptionResponse] { @@ -418,7 +418,7 @@ func (client *PartnerConfigurationsClient) listBySubscriptionCreateRequest(ctx c if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -436,7 +436,7 @@ func (client *PartnerConfigurationsClient) listBySubscriptionHandleResponse(resp // UnauthorizePartner - Unauthorize a single partner either by partner registration immutable Id or by partner name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerInfo - The information of the partner to be unauthorized. // - options - PartnerConfigurationsClientUnauthorizePartnerOptions contains the optional parameters for the PartnerConfigurationsClient.UnauthorizePartner @@ -479,7 +479,7 @@ func (client *PartnerConfigurationsClient) unauthorizePartnerCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerInfo); err != nil { @@ -500,7 +500,7 @@ func (client *PartnerConfigurationsClient) unauthorizePartnerHandleResponse(resp // BeginUpdate - Synchronously updates a partner configuration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerConfigurationUpdateParameters - Partner configuration update information. // - options - PartnerConfigurationsClientBeginUpdateOptions contains the optional parameters for the PartnerConfigurationsClient.BeginUpdate @@ -525,7 +525,7 @@ func (client *PartnerConfigurationsClient) BeginUpdate(ctx context.Context, reso // Update - Synchronously updates a partner configuration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerConfigurationsClient) update(ctx context.Context, resourceGroupName string, partnerConfigurationUpdateParameters PartnerConfigurationUpdateParameters, options *PartnerConfigurationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerConfigurationsClient.BeginUpdate" @@ -563,7 +563,7 @@ func (client *PartnerConfigurationsClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerConfigurationUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client_example_test.go deleted file mode 100644 index e4affe6c0d6e..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client_example_test.go +++ /dev/null @@ -1,418 +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 armeventgrid_test - -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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_Get.json -func ExamplePartnerConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerConfigurationsClient().Get(ctx, "examplerg", 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.PartnerConfiguration = armeventgrid.PartnerConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.EventGrid/partnerConfigurations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerConfigurations/default"), - // Location: to.Ptr("global"), - // Properties: &armeventgrid.PartnerConfigurationProperties{ - // PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - // AuthorizedPartnersList: []*armeventgrid.Partner{ - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t}()), - // PartnerName: to.Ptr("Contoso.Finance"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // }, - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t}()), - // PartnerName: to.Ptr("fabrikam.HR"), - // PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - // }}, - // DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_CreateOrUpdate.json -func ExamplePartnerConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerConfigurationsClient().BeginCreateOrUpdate(ctx, "examplerg", armeventgrid.PartnerConfiguration{ - Properties: &armeventgrid.PartnerConfigurationProperties{ - PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - AuthorizedPartnersList: []*armeventgrid.Partner{ - { - AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t }()), - PartnerName: to.Ptr("Contoso.Finance"), - PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - }, - { - AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t }()), - PartnerName: to.Ptr("fabrikam.HR"), - PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - }}, - DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), - }, - }, - }, 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.PartnerConfiguration = armeventgrid.PartnerConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.EventGrid/partnerConfigurations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerConfigurations/default"), - // Location: to.Ptr("global"), - // Properties: &armeventgrid.PartnerConfigurationProperties{ - // PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - // AuthorizedPartnersList: []*armeventgrid.Partner{ - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t}()), - // PartnerName: to.Ptr("Contoso.Finance"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // }, - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t}()), - // PartnerName: to.Ptr("fabrikam.HR"), - // PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - // }}, - // DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_Delete.json -func ExamplePartnerConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerConfigurationsClient().BeginDelete(ctx, "examplerg", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_Update.json -func ExamplePartnerConfigurationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerConfigurationsClient().BeginUpdate(ctx, "examplerg", armeventgrid.PartnerConfigurationUpdateParameters{ - Properties: &armeventgrid.PartnerConfigurationUpdateParameterProperties{ - DefaultMaximumExpirationTimeInDays: to.Ptr[int32](100), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value11"), - "tag2": to.Ptr("value22"), - }, - }, 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.PartnerConfiguration = armeventgrid.PartnerConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.EventGrid/partnerConfigurations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerConfigurations/default"), - // Location: to.Ptr("global"), - // Properties: &armeventgrid.PartnerConfigurationProperties{ - // PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - // AuthorizedPartnersList: []*armeventgrid.Partner{ - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t}()), - // PartnerName: to.Ptr("Contoso.Finance"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // }, - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t}()), - // PartnerName: to.Ptr("fabrikam.HR"), - // PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - // }}, - // DefaultMaximumExpirationTimeInDays: to.Ptr[int32](100), - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value11"), - // "tag2": to.Ptr("value22"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_ListByResourceGroup.json -func ExamplePartnerConfigurationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerConfigurationsClient().NewListByResourceGroupPager("examplerg", 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.PartnerConfigurationsListResult = armeventgrid.PartnerConfigurationsListResult{ - // Value: []*armeventgrid.PartnerConfiguration{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.EventGrid/partnerConfigurations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerConfigurations/default"), - // Location: to.Ptr("global"), - // Properties: &armeventgrid.PartnerConfigurationProperties{ - // PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - // AuthorizedPartnersList: []*armeventgrid.Partner{ - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t}()), - // PartnerName: to.Ptr("Contoso.Finance"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // }, - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t}()), - // PartnerName: to.Ptr("fabrikam.HR"), - // PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - // }}, - // DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_ListBySubscription.json -func ExamplePartnerConfigurationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerConfigurationsClient().NewListBySubscriptionPager(&armeventgrid.PartnerConfigurationsClientListBySubscriptionOptions{Filter: nil, - Top: 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.PartnerConfigurationsListResult = armeventgrid.PartnerConfigurationsListResult{ - // Value: []*armeventgrid.PartnerConfiguration{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.EventGrid/partnerConfigurations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerConfigurations/default"), - // Location: to.Ptr("global"), - // Properties: &armeventgrid.PartnerConfigurationProperties{ - // PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - // AuthorizedPartnersList: []*armeventgrid.Partner{ - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t}()), - // PartnerName: to.Ptr("Contoso.Finance"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // }, - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t}()), - // PartnerName: to.Ptr("fabrikam.HR"), - // PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - // }}, - // DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_AuthorizePartner.json -func ExamplePartnerConfigurationsClient_AuthorizePartner() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerConfigurationsClient().AuthorizePartner(ctx, "examplerg", armeventgrid.Partner{ - AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t }()), - PartnerName: to.Ptr("Contoso.Finance"), - PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - }, 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.PartnerConfiguration = armeventgrid.PartnerConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.EventGrid/partnerConfigurations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerConfigurations/default"), - // Location: to.Ptr("global"), - // Properties: &armeventgrid.PartnerConfigurationProperties{ - // PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - // AuthorizedPartnersList: []*armeventgrid.Partner{ - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t}()), - // PartnerName: to.Ptr("Contoso.Finance"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // }, - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t}()), - // PartnerName: to.Ptr("fabrikam.HR"), - // PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - // }}, - // DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_UnauthorizePartner.json -func ExamplePartnerConfigurationsClient_UnauthorizePartner() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerConfigurationsClient().UnauthorizePartner(ctx, "examplerg", armeventgrid.Partner{ - AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t }()), - PartnerName: to.Ptr("Contoso.Finance"), - PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - }, 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.PartnerConfiguration = armeventgrid.PartnerConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.EventGrid/partnerConfigurations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerConfigurations/default"), - // Location: to.Ptr("global"), - // Properties: &armeventgrid.PartnerConfigurationProperties{ - // PartnerAuthorization: &armeventgrid.PartnerAuthorization{ - // AuthorizedPartnersList: []*armeventgrid.Partner{ - // { - // AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t}()), - // PartnerName: to.Ptr("fabrikam.HR"), - // PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), - // }}, - // DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), - // }, - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnerdestinations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnerdestinations_client.go new file mode 100644 index 000000000000..213caf84ed87 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnerdestinations_client.go @@ -0,0 +1,538 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armeventgrid + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// PartnerDestinationsClient contains the methods for the PartnerDestinations group. +// Don't use this type directly, use NewPartnerDestinationsClient() instead. +type PartnerDestinationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPartnerDestinationsClient creates a new instance of PartnerDestinationsClient with the specified values. +// - subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPartnerDestinationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerDestinationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PartnerDestinationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Activate - Activate a newly created partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - partnerDestinationName - Name of the partner destination. +// - options - PartnerDestinationsClientActivateOptions contains the optional parameters for the PartnerDestinationsClient.Activate +// method. +func (client *PartnerDestinationsClient) Activate(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientActivateOptions) (PartnerDestinationsClientActivateResponse, error) { + var err error + const operationName = "PartnerDestinationsClient.Activate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.activateCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PartnerDestinationsClientActivateResponse{}, err + } + resp, err := client.activateHandleResponse(httpResp) + return resp, err +} + +// activateCreateRequest creates the Activate request. +func (client *PartnerDestinationsClient) activateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, _ *PartnerDestinationsClientActivateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}/activate" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// activateHandleResponse handles the Activate response. +func (client *PartnerDestinationsClient) activateHandleResponse(resp *http.Response) (PartnerDestinationsClientActivateResponse, error) { + result := PartnerDestinationsClientActivateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestination); err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdate - Asynchronously creates a new partner destination with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - partnerDestinationName - Name of the partner destination. +// - partnerDestination - Partner destination create information. +// - options - PartnerDestinationsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerDestinationsClient.BeginCreateOrUpdate +// method. +func (client *PartnerDestinationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination PartnerDestination, options *PartnerDestinationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PartnerDestinationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, partnerDestinationName, partnerDestination, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PartnerDestinationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PartnerDestinationsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Asynchronously creates a new partner destination with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +func (client *PartnerDestinationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination PartnerDestination, options *PartnerDestinationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "PartnerDestinationsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerDestinationName, partnerDestination, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerDestinationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination PartnerDestination, _ *PartnerDestinationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, partnerDestination); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete existing partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - partnerDestinationName - Name of the partner destination. +// - options - PartnerDestinationsClientBeginDeleteOptions contains the optional parameters for the PartnerDestinationsClient.BeginDelete +// method. +func (client *PartnerDestinationsClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientBeginDeleteOptions) (*runtime.Poller[PartnerDestinationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PartnerDestinationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PartnerDestinationsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete existing partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +func (client *PartnerDestinationsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "PartnerDestinationsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerDestinationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, _ *PartnerDestinationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - partnerDestinationName - Name of the partner destination. +// - options - PartnerDestinationsClientGetOptions contains the optional parameters for the PartnerDestinationsClient.Get method. +func (client *PartnerDestinationsClient) Get(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientGetOptions) (PartnerDestinationsClientGetResponse, error) { + var err error + const operationName = "PartnerDestinationsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PartnerDestinationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PartnerDestinationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, _ *PartnerDestinationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PartnerDestinationsClient) getHandleResponse(resp *http.Response) (PartnerDestinationsClientGetResponse, error) { + result := PartnerDestinationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestination); err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the partner destinations under a resource group. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - options - PartnerDestinationsClientListByResourceGroupOptions contains the optional parameters for the PartnerDestinationsClient.NewListByResourceGroupPager +// method. +func (client *PartnerDestinationsClient) NewListByResourceGroupPager(resourceGroupName string, options *PartnerDestinationsClientListByResourceGroupOptions) *runtime.Pager[PartnerDestinationsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerDestinationsClientListByResourceGroupResponse]{ + More: func(page PartnerDestinationsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerDestinationsClientListByResourceGroupResponse) (PartnerDestinationsClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PartnerDestinationsClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return PartnerDestinationsClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PartnerDestinationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerDestinationsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *PartnerDestinationsClient) listByResourceGroupHandleResponse(resp *http.Response) (PartnerDestinationsClientListByResourceGroupResponse, error) { + result := PartnerDestinationsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestinationsListResult); err != nil { + return PartnerDestinationsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the partner destinations under an Azure subscription. +// +// Generated from API version 2025-04-01-preview +// - options - PartnerDestinationsClientListBySubscriptionOptions contains the optional parameters for the PartnerDestinationsClient.NewListBySubscriptionPager +// method. +func (client *PartnerDestinationsClient) NewListBySubscriptionPager(options *PartnerDestinationsClientListBySubscriptionOptions) *runtime.Pager[PartnerDestinationsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerDestinationsClientListBySubscriptionResponse]{ + More: func(page PartnerDestinationsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerDestinationsClientListBySubscriptionResponse) (PartnerDestinationsClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PartnerDestinationsClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return PartnerDestinationsClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PartnerDestinationsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PartnerDestinationsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerDestinations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PartnerDestinationsClient) listBySubscriptionHandleResponse(resp *http.Response) (PartnerDestinationsClientListBySubscriptionResponse, error) { + result := PartnerDestinationsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestinationsListResult); err != nil { + return PartnerDestinationsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdate - Asynchronously updates a partner destination with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - partnerDestinationName - Name of the partner destination. +// - partnerDestinationUpdateParameters - Partner destination update information. +// - options - PartnerDestinationsClientBeginUpdateOptions contains the optional parameters for the PartnerDestinationsClient.BeginUpdate +// method. +func (client *PartnerDestinationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters PartnerDestinationUpdateParameters, options *PartnerDestinationsClientBeginUpdateOptions) (*runtime.Poller[PartnerDestinationsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, partnerDestinationName, partnerDestinationUpdateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PartnerDestinationsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PartnerDestinationsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Asynchronously updates a partner destination with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-01-preview +func (client *PartnerDestinationsClient) update(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters PartnerDestinationUpdateParameters, options *PartnerDestinationsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "PartnerDestinationsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerDestinationName, partnerDestinationUpdateParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PartnerDestinationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters PartnerDestinationUpdateParameters, _ *PartnerDestinationsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, partnerDestinationUpdateParameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go index 743fe86d19a5..8ae95b99e48f 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go @@ -45,7 +45,7 @@ func NewPartnerNamespacesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Asynchronously creates a new partner namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerNamespaceName - Name of the partner namespace. // - partnerNamespaceInfo - PartnerNamespace information. @@ -71,7 +71,7 @@ func (client *PartnerNamespacesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Asynchronously creates a new partner namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerNamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceInfo PartnerNamespace, options *PartnerNamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerNamespacesClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *PartnerNamespacesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerNamespaceInfo); err != nil { @@ -125,7 +125,7 @@ func (client *PartnerNamespacesClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Delete existing partner namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerNamespaceName - Name of the partner namespace. // - options - PartnerNamespacesClientBeginDeleteOptions contains the optional parameters for the PartnerNamespacesClient.BeginDelete @@ -150,7 +150,7 @@ func (client *PartnerNamespacesClient) BeginDelete(ctx context.Context, resource // Delete - Delete existing partner namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerNamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PartnerNamespacesClient.BeginDelete" @@ -192,7 +192,7 @@ func (client *PartnerNamespacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *PartnerNamespacesClient) deleteCreateRequest(ctx context.Context, // Get - Get properties of a partner namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerNamespaceName - Name of the partner namespace. // - options - PartnerNamespacesClientGetOptions contains the optional parameters for the PartnerNamespacesClient.Get method. @@ -247,7 +247,7 @@ func (client *PartnerNamespacesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *PartnerNamespacesClient) getHandleResponse(resp *http.Response) (P // NewListByResourceGroupPager - List all the partner namespaces under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - PartnerNamespacesClientListByResourceGroupOptions contains the optional parameters for the PartnerNamespacesClient.NewListByResourceGroupPager // method. @@ -313,7 +313,7 @@ func (client *PartnerNamespacesClient) listByResourceGroupCreateRequest(ctx cont if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *PartnerNamespacesClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List all the partner namespaces under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - PartnerNamespacesClientListBySubscriptionOptions contains the optional parameters for the PartnerNamespacesClient.NewListBySubscriptionPager // method. func (client *PartnerNamespacesClient) NewListBySubscriptionPager(options *PartnerNamespacesClientListBySubscriptionOptions) *runtime.Pager[PartnerNamespacesClientListBySubscriptionResponse] { @@ -374,7 +374,7 @@ func (client *PartnerNamespacesClient) listBySubscriptionCreateRequest(ctx conte if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *PartnerNamespacesClient) listBySubscriptionHandleResponse(resp *ht // ListSharedAccessKeys - List the two keys used to publish to a partner namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerNamespaceName - Name of the partner namespace. // - options - PartnerNamespacesClientListSharedAccessKeysOptions contains the optional parameters for the PartnerNamespacesClient.ListSharedAccessKeys @@ -439,7 +439,7 @@ func (client *PartnerNamespacesClient) listSharedAccessKeysCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -457,7 +457,7 @@ func (client *PartnerNamespacesClient) listSharedAccessKeysHandleResponse(resp * // RegenerateKey - Regenerate a shared access key for a partner namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerNamespaceName - Name of the partner namespace. // - regenerateKeyRequest - Request body to regenerate key. @@ -505,7 +505,7 @@ func (client *PartnerNamespacesClient) regenerateKeyCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateKeyRequest); err != nil { @@ -526,7 +526,7 @@ func (client *PartnerNamespacesClient) regenerateKeyHandleResponse(resp *http.Re // BeginUpdate - Asynchronously updates a partner namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerNamespaceName - Name of the partner namespace. // - partnerNamespaceUpdateParameters - Partner namespace update information. @@ -552,7 +552,7 @@ func (client *PartnerNamespacesClient) BeginUpdate(ctx context.Context, resource // Update - Asynchronously updates a partner namespace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerNamespacesClient) update(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceUpdateParameters PartnerNamespaceUpdateParameters, options *PartnerNamespacesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerNamespacesClient.BeginUpdate" @@ -594,7 +594,7 @@ func (client *PartnerNamespacesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerNamespaceUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client_example_test.go deleted file mode 100644 index 4450d9c67c9c..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client_example_test.go +++ /dev/null @@ -1,273 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Get.json -func ExamplePartnerNamespacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerNamespacesClient().Get(ctx, "examplerg", "examplePartnerNamespaceName1", 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.PartnerNamespace = armeventgrid.PartnerNamespace{ - // Name: to.Ptr("examplePartnerNamespaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerNamespaces"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerNamespaces/examplePartnerNamespaceName1"), - // Location: to.Ptr("Central US EUAP"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // "key3": to.Ptr("value3"), - // }, - // Properties: &armeventgrid.PartnerNamespaceProperties{ - // Endpoint: to.Ptr("https://examplePartnerNamespaceName1.centraluseuap-1.eventgrid.azure.net/api/events"), - // PartnerRegistrationFullyQualifiedID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerNamespaceProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_CreateOrUpdate.json -func ExamplePartnerNamespacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerNamespacesClient().BeginCreateOrUpdate(ctx, "examplerg", "examplePartnerNamespaceName1", armeventgrid.PartnerNamespace{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armeventgrid.PartnerNamespaceProperties{ - PartnerRegistrationFullyQualifiedID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Delete.json -func ExamplePartnerNamespacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerNamespacesClient().BeginDelete(ctx, "examplerg", "examplePartnerNamespaceName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Update.json -func ExamplePartnerNamespacesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerNamespacesClient().BeginUpdate(ctx, "examplerg", "examplePartnerNamespaceName1", armeventgrid.PartnerNamespaceUpdateParameters{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_ListBySubscription.json -func ExamplePartnerNamespacesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerNamespacesClient().NewListBySubscriptionPager(&armeventgrid.PartnerNamespacesClientListBySubscriptionOptions{Filter: nil, - Top: 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.PartnerNamespacesListResult = armeventgrid.PartnerNamespacesListResult{ - // Value: []*armeventgrid.PartnerNamespace{ - // { - // Name: to.Ptr("partnerNamespace123"), - // Type: to.Ptr("Microsoft.EventGrid/partnerNamespaces"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/amh/providers/Microsoft.EventGrid/partnerNamespaces/partnerNamespace123"), - // Location: to.Ptr("Central US EUAP"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // "key3": to.Ptr("value3"), - // }, - // Properties: &armeventgrid.PartnerNamespaceProperties{ - // Endpoint: to.Ptr("https://partnernamespace123.centraluseuap-1.eventgrid.azure.net/api/events"), - // PartnerRegistrationFullyQualifiedID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/amh/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerNamespaceProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_ListByResourceGroup.json -func ExamplePartnerNamespacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerNamespacesClient().NewListByResourceGroupPager("examplerg", &armeventgrid.PartnerNamespacesClientListByResourceGroupOptions{Filter: nil, - Top: 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.PartnerNamespacesListResult = armeventgrid.PartnerNamespacesListResult{ - // Value: []*armeventgrid.PartnerNamespace{ - // { - // Name: to.Ptr("partnerNamespace123"), - // Type: to.Ptr("Microsoft.EventGrid/partnerNamespaces"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerNamespaces/partnerNamespace123"), - // Location: to.Ptr("Central US EUAP"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // "key3": to.Ptr("value3"), - // }, - // Properties: &armeventgrid.PartnerNamespaceProperties{ - // Endpoint: to.Ptr("https://partnernamespace123.centraluseuap-1.eventgrid.azure.net/api/events"), - // PartnerRegistrationFullyQualifiedID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerNamespaceProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_ListSharedAccessKeys.json -func ExamplePartnerNamespacesClient_ListSharedAccessKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerNamespacesClient().ListSharedAccessKeys(ctx, "examplerg", "examplePartnerNamespaceName1", 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.PartnerNamespaceSharedAccessKeys = armeventgrid.PartnerNamespaceSharedAccessKeys{ - // Key1: to.Ptr("testKey1Value"), - // Key2: to.Ptr("testKey2Value"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_RegenerateKey.json -func ExamplePartnerNamespacesClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerNamespacesClient().RegenerateKey(ctx, "examplerg", "examplePartnerNamespaceName1", armeventgrid.PartnerNamespaceRegenerateKeyRequest{ - KeyName: to.Ptr("key1"), - }, 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.PartnerNamespaceSharedAccessKeys = armeventgrid.PartnerNamespaceSharedAccessKeys{ - // Key1: to.Ptr("testKey1Value"), - // Key2: to.Ptr("testKey2Value"), - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client.go index fad8a18019fb..011638e600d9 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client.go @@ -45,7 +45,7 @@ func NewPartnerRegistrationsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates a new partner registration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerRegistrationName - Name of the partner registration. // - partnerRegistrationInfo - PartnerRegistration information. @@ -71,7 +71,7 @@ func (client *PartnerRegistrationsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates a new partner registration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerRegistrationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationInfo PartnerRegistration, options *PartnerRegistrationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerRegistrationsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *PartnerRegistrationsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerRegistrationInfo); err != nil { @@ -125,7 +125,7 @@ func (client *PartnerRegistrationsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes a partner registration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerRegistrationName - Name of the partner registration. // - options - PartnerRegistrationsClientBeginDeleteOptions contains the optional parameters for the PartnerRegistrationsClient.BeginDelete @@ -150,7 +150,7 @@ func (client *PartnerRegistrationsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes a partner registration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerRegistrationsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerRegistrationName string, options *PartnerRegistrationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PartnerRegistrationsClient.BeginDelete" @@ -192,7 +192,7 @@ func (client *PartnerRegistrationsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -200,7 +200,7 @@ func (client *PartnerRegistrationsClient) deleteCreateRequest(ctx context.Contex // Get - Gets a partner registration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerRegistrationName - Name of the partner registration. // - options - PartnerRegistrationsClientGetOptions contains the optional parameters for the PartnerRegistrationsClient.Get @@ -247,7 +247,7 @@ func (client *PartnerRegistrationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *PartnerRegistrationsClient) getHandleResponse(resp *http.Response) // NewListByResourceGroupPager - List all the partner registrations under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - PartnerRegistrationsClientListByResourceGroupOptions contains the optional parameters for the PartnerRegistrationsClient.NewListByResourceGroupPager // method. @@ -313,7 +313,7 @@ func (client *PartnerRegistrationsClient) listByResourceGroupCreateRequest(ctx c if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *PartnerRegistrationsClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - List all the partner registrations under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - PartnerRegistrationsClientListBySubscriptionOptions contains the optional parameters for the PartnerRegistrationsClient.NewListBySubscriptionPager // method. func (client *PartnerRegistrationsClient) NewListBySubscriptionPager(options *PartnerRegistrationsClientListBySubscriptionOptions) *runtime.Pager[PartnerRegistrationsClientListBySubscriptionResponse] { @@ -374,7 +374,7 @@ func (client *PartnerRegistrationsClient) listBySubscriptionCreateRequest(ctx co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *PartnerRegistrationsClient) listBySubscriptionHandleResponse(resp // BeginUpdate - Updates a partner registration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerRegistrationName - Name of the partner registration. // - partnerRegistrationUpdateParameters - Partner registration update information. @@ -418,7 +418,7 @@ func (client *PartnerRegistrationsClient) BeginUpdate(ctx context.Context, resou // Update - Updates a partner registration with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerRegistrationsClient) update(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationUpdateParameters PartnerRegistrationUpdateParameters, options *PartnerRegistrationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerRegistrationsClient.BeginUpdate" @@ -460,7 +460,7 @@ func (client *PartnerRegistrationsClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerRegistrationUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client_example_test.go deleted file mode 100644 index caad421a7eea..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client_example_test.go +++ /dev/null @@ -1,237 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_Get.json -func ExamplePartnerRegistrationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerRegistrationsClient().Get(ctx, "examplerg", "examplePartnerRegistrationName1", 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.PartnerRegistration = armeventgrid.PartnerRegistration{ - // Name: to.Ptr("examplePartnerRegistrationName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerRegistrations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/examplePartnerRegistrationName1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("Value2"), - // "key3": to.Ptr("Value3"), - // }, - // Properties: &armeventgrid.PartnerRegistrationProperties{ - // PartnerRegistrationImmutableID: to.Ptr("6a1e637f-1495-4938-bf46-ff468b9a75d2"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerRegistrationProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_CreateOrUpdate.json -func ExamplePartnerRegistrationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerRegistrationsClient().BeginCreateOrUpdate(ctx, "examplerg", "examplePartnerRegistrationName1", armeventgrid.PartnerRegistration{ - Location: to.Ptr("global"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("Value2"), - "key3": to.Ptr("Value3"), - }, - }, 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.PartnerRegistration = armeventgrid.PartnerRegistration{ - // Name: to.Ptr("examplePartnerRegistrationName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerRegistrations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/examplePartnerRegistrationName1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("Value2"), - // "key3": to.Ptr("Value3"), - // }, - // Properties: &armeventgrid.PartnerRegistrationProperties{ - // PartnerRegistrationImmutableID: to.Ptr("6a1e637f-1495-4938-bf46-ff468b9a75d2"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerRegistrationProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_Delete.json -func ExamplePartnerRegistrationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerRegistrationsClient().BeginDelete(ctx, "examplerg", "examplePartnerRegistrationName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_Update.json -func ExamplePartnerRegistrationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerRegistrationsClient().BeginUpdate(ctx, "examplerg", "examplePartnerRegistrationName1", armeventgrid.PartnerRegistrationUpdateParameters{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_ListBySubscription.json -func ExamplePartnerRegistrationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerRegistrationsClient().NewListBySubscriptionPager(&armeventgrid.PartnerRegistrationsClientListBySubscriptionOptions{Filter: nil, - Top: 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.PartnerRegistrationsListResult = armeventgrid.PartnerRegistrationsListResult{ - // Value: []*armeventgrid.PartnerRegistration{ - // { - // Name: to.Ptr("ContosoCorpAccount1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerRegistrations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/amh/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("Value2"), - // "key3": to.Ptr("Value3"), - // }, - // Properties: &armeventgrid.PartnerRegistrationProperties{ - // PartnerRegistrationImmutableID: to.Ptr("6a1e637f-1495-4938-bf46-ff468b9a75d2"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerRegistrationProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_ListByResourceGroup.json -func ExamplePartnerRegistrationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerRegistrationsClient().NewListByResourceGroupPager("examplerg", &armeventgrid.PartnerRegistrationsClientListByResourceGroupOptions{Filter: nil, - Top: 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.PartnerRegistrationsListResult = armeventgrid.PartnerRegistrationsListResult{ - // Value: []*armeventgrid.PartnerRegistration{ - // { - // Name: to.Ptr("ContosoCorpAccount1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerRegistrations"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/amh/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("Value2"), - // "key3": to.Ptr("Value3"), - // }, - // Properties: &armeventgrid.PartnerRegistrationProperties{ - // PartnerRegistrationImmutableID: to.Ptr("6a1e637f-1495-4938-bf46-ff468b9a75d2"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerRegistrationProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client.go index 89e479037ed2..722135beab8b 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client.go @@ -46,7 +46,7 @@ func NewPartnerTopicEventSubscriptionsClient(subscriptionID string, credential a // Existing event subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 64 @@ -75,7 +75,7 @@ func (client *PartnerTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx cont // Existing event subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerTopicEventSubscriptionsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *PartnerTopicEventSubscriptionsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionInfo); err != nil { @@ -133,7 +133,7 @@ func (client *PartnerTopicEventSubscriptionsClient) createOrUpdateCreateRequest( // BeginDelete - Delete an existing event subscription of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - eventSubscriptionName - Name of the event subscription to be deleted. @@ -159,7 +159,7 @@ func (client *PartnerTopicEventSubscriptionsClient) BeginDelete(ctx context.Cont // Delete - Delete an existing event subscription of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PartnerTopicEventSubscriptionsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *PartnerTopicEventSubscriptionsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -213,7 +213,7 @@ func (client *PartnerTopicEventSubscriptionsClient) deleteCreateRequest(ctx cont // Get - Get properties of an event subscription of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - eventSubscriptionName - Name of the event subscription to be found. @@ -265,7 +265,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getHandleResponse(resp *http // GetDeliveryAttributes - Get all delivery attributes for an event subscription of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - eventSubscriptionName - Name of the event subscription. @@ -335,7 +335,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getDeliveryAttributesCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +353,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getDeliveryAttributesHandleR // GetFullURL - Get the full endpoint URL for an event subscription of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - eventSubscriptionName - Name of the event subscription. @@ -405,7 +405,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +422,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getFullURLHandleResponse(res // NewListByPartnerTopicPager - List event subscriptions that belong to a specific partner topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - options - PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.NewListByPartnerTopicPager @@ -476,7 +476,7 @@ func (client *PartnerTopicEventSubscriptionsClient) listByPartnerTopicCreateRequ if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,7 +494,7 @@ func (client *PartnerTopicEventSubscriptionsClient) listByPartnerTopicHandleResp // BeginUpdate - Update an existing event subscription of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - eventSubscriptionName - Name of the event subscription to be updated. @@ -521,7 +521,7 @@ func (client *PartnerTopicEventSubscriptionsClient) BeginUpdate(ctx context.Cont // Update - Update an existing event subscription of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *PartnerTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PartnerTopicEventSubscriptionsClient.BeginUpdate" @@ -567,7 +567,7 @@ func (client *PartnerTopicEventSubscriptionsClient) updateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client_example_test.go deleted file mode 100644 index 4ee6b95f4cc2..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopicEventSubscriptions_Get.json -func ExamplePartnerTopicEventSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerTopicEventSubscriptionsClient().Get(ctx, "examplerg", "examplePartnerTopic1", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopicEventSubscriptions_CreateOrUpdate.json -func ExamplePartnerTopicEventSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerTopicEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "examplerg", "examplePartnerTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("exampleEventSubscriptionName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1/eventSubscriptions/exampleEventSubscriptionName1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopicEventSubscriptions_Delete.json -func ExamplePartnerTopicEventSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerTopicEventSubscriptionsClient().BeginDelete(ctx, "examplerg", "examplePartnerTopic1", "examplesubscription1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopicEventSubscriptions_Update.json -func ExamplePartnerTopicEventSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerTopicEventSubscriptionsClient().BeginUpdate(ctx, "examplerg", "examplePartnerTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopicEventSubscriptions_GetFullUrl.json -func ExamplePartnerTopicEventSubscriptionsClient_GetFullURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerTopicEventSubscriptionsClient().GetFullURL(ctx, "examplerg", "examplePartnerTopic1", "examplesubscription1", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopicEventSubscriptions_ListByPartnerTopic.json -func ExamplePartnerTopicEventSubscriptionsClient_NewListByPartnerTopicPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerTopicEventSubscriptionsClient().NewListByPartnerTopicPager("examplerg", "examplePartnerTopic1", &armeventgrid.PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // Labels: []*string{ - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](10), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription2"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1/eventSubscriptions/examplesubscription2"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopicEventSubscriptions_GetDeliveryAttributes.json -func ExamplePartnerTopicEventSubscriptionsClient_GetDeliveryAttributes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerTopicEventSubscriptionsClient().GetDeliveryAttributes(ctx, "examplerg", "examplePartnerTopic1", "examplesubscription1", 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.DeliveryAttributeListResult = armeventgrid.DeliveryAttributeListResult{ - // Value: []armeventgrid.DeliveryAttributeMappingClassification{ - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header1"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(false), - // Value: to.Ptr("NormalValue"), - // }, - // }, - // &armeventgrid.DynamicDeliveryAttributeMapping{ - // Name: to.Ptr("header2"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeDynamic), - // Properties: &armeventgrid.DynamicDeliveryAttributeMappingProperties{ - // SourceField: to.Ptr("data.foo"), - // }, - // }, - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header3"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(true), - // Value: to.Ptr("mySecretValue"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client.go index 837c27b62ed3..ce9b95a17287 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client.go @@ -45,7 +45,7 @@ func NewPartnerTopicsClient(subscriptionID string, credential azcore.TokenCreden // Activate - Activate a newly created partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - options - PartnerTopicsClientActivateOptions contains the optional parameters for the PartnerTopicsClient.Activate method. @@ -91,7 +91,7 @@ func (client *PartnerTopicsClient) activateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *PartnerTopicsClient) activateHandleResponse(resp *http.Response) ( // CreateOrUpdate - Asynchronously creates a new partner topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - partnerTopicInfo - Partner Topic information. @@ -157,7 +157,7 @@ func (client *PartnerTopicsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerTopicInfo); err != nil { @@ -178,7 +178,7 @@ func (client *PartnerTopicsClient) createOrUpdateHandleResponse(resp *http.Respo // Deactivate - Deactivate specific partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - options - PartnerTopicsClientDeactivateOptions contains the optional parameters for the PartnerTopicsClient.Deactivate @@ -225,7 +225,7 @@ func (client *PartnerTopicsClient) deactivateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +243,7 @@ func (client *PartnerTopicsClient) deactivateHandleResponse(resp *http.Response) // BeginDelete - Delete existing partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - options - PartnerTopicsClientBeginDeleteOptions contains the optional parameters for the PartnerTopicsClient.BeginDelete @@ -268,7 +268,7 @@ func (client *PartnerTopicsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete existing partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PartnerTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PartnerTopicsClient.BeginDelete" @@ -310,7 +310,7 @@ func (client *PartnerTopicsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -318,7 +318,7 @@ func (client *PartnerTopicsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get properties of a partner topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - options - PartnerTopicsClientGetOptions contains the optional parameters for the PartnerTopicsClient.Get method. @@ -364,7 +364,7 @@ func (client *PartnerTopicsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,7 +381,7 @@ func (client *PartnerTopicsClient) getHandleResponse(resp *http.Response) (Partn // NewListByResourceGroupPager - List all the partner topics under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - PartnerTopicsClientListByResourceGroupOptions contains the optional parameters for the PartnerTopicsClient.NewListByResourceGroupPager // method. @@ -430,7 +430,7 @@ func (client *PartnerTopicsClient) listByResourceGroupCreateRequest(ctx context. if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -447,7 +447,7 @@ func (client *PartnerTopicsClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - List all the partner topics under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - PartnerTopicsClientListBySubscriptionOptions contains the optional parameters for the PartnerTopicsClient.NewListBySubscriptionPager // method. func (client *PartnerTopicsClient) NewListBySubscriptionPager(options *PartnerTopicsClientListBySubscriptionOptions) *runtime.Pager[PartnerTopicsClientListBySubscriptionResponse] { @@ -491,7 +491,7 @@ func (client *PartnerTopicsClient) listBySubscriptionCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -509,7 +509,7 @@ func (client *PartnerTopicsClient) listBySubscriptionHandleResponse(resp *http.R // Update - Asynchronously updates a partner topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - partnerTopicUpdateParameters - PartnerTopic update information. @@ -556,7 +556,7 @@ func (client *PartnerTopicsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, partnerTopicUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client_example_test.go deleted file mode 100644 index dc6d41264da0..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client_example_test.go +++ /dev/null @@ -1,287 +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 armeventgrid_test - -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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Get.json -func ExamplePartnerTopicsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerTopicsClient().Get(ctx, "examplerg", "examplePartnerTopicName1", 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.PartnerTopic = armeventgrid.PartnerTopic{ - // Name: to.Ptr("examplePartnerTopicName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopicName1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.PartnerTopicProperties{ - // ActivationState: to.Ptr(armeventgrid.PartnerTopicActivationStateNeverActivated), - // ProvisioningState: to.Ptr(armeventgrid.PartnerTopicProvisioningStateSucceeded), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_CreateOrUpdate.json -func ExamplePartnerTopicsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerTopicsClient().CreateOrUpdate(ctx, "examplerg", "examplePartnerTopicName1", armeventgrid.PartnerTopic{ - Location: to.Ptr("westus2"), - Properties: &armeventgrid.PartnerTopicProperties{ - ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T23:06:13.109Z"); return t }()), - MessageForActivation: to.Ptr("Example message for activation"), - PartnerRegistrationImmutableID: to.Ptr("6f541064-031d-4cc8-9ec3-a3b4fc0f7185"), - PartnerTopicFriendlyDescription: to.Ptr("Example description"), - Source: to.Ptr("ContosoCorp.Accounts.User1"), - }, - }, 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.PartnerTopic = armeventgrid.PartnerTopic{ - // Name: to.Ptr("examplePartnerTopicName1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopicName1"), - // Location: to.Ptr("centraluseuap"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.PartnerTopicProperties{ - // ActivationState: to.Ptr(armeventgrid.PartnerTopicActivationStateNeverActivated), - // ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T23:06:13.109Z"); return t}()), - // MessageForActivation: to.Ptr("Example message for activation"), - // PartnerRegistrationImmutableID: to.Ptr("6f541064-031d-4cc8-9ec3-a3b4fc0f7185"), - // PartnerTopicFriendlyDescription: to.Ptr("Example description"), - // ProvisioningState: to.Ptr(armeventgrid.PartnerTopicProvisioningStateSucceeded), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Delete.json -func ExamplePartnerTopicsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPartnerTopicsClient().BeginDelete(ctx, "examplerg", "examplePartnerTopicName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Update.json -func ExamplePartnerTopicsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPartnerTopicsClient().Update(ctx, "examplerg", "examplePartnerTopicName1", armeventgrid.PartnerTopicUpdateParameters{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_ListBySubscription.json -func ExamplePartnerTopicsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerTopicsClient().NewListBySubscriptionPager(&armeventgrid.PartnerTopicsClientListBySubscriptionOptions{Filter: nil, - Top: 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.PartnerTopicsListResult = armeventgrid.PartnerTopicsListResult{ - // Value: []*armeventgrid.PartnerTopic{ - // { - // Name: to.Ptr("examplePartnerTopic1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/amh/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.PartnerTopicProperties{ - // ActivationState: to.Ptr(armeventgrid.PartnerTopicActivationStateNeverActivated), - // ProvisioningState: to.Ptr(armeventgrid.PartnerTopicProvisioningStateSucceeded), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_ListByResourceGroup.json -func ExamplePartnerTopicsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPartnerTopicsClient().NewListByResourceGroupPager("examplerg", &armeventgrid.PartnerTopicsClientListByResourceGroupOptions{Filter: nil, - Top: 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.PartnerTopicsListResult = armeventgrid.PartnerTopicsListResult{ - // Value: []*armeventgrid.PartnerTopic{ - // { - // Name: to.Ptr("examplePartnerTopic1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/amh/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.PartnerTopicProperties{ - // ActivationState: to.Ptr(armeventgrid.PartnerTopicActivationStateNeverActivated), - // ProvisioningState: to.Ptr(armeventgrid.PartnerTopicProvisioningStateSucceeded), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Activate.json -func ExamplePartnerTopicsClient_Activate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerTopicsClient().Activate(ctx, "examplerg", "examplePartnerTopic1", 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.PartnerTopic = armeventgrid.PartnerTopic{ - // Name: to.Ptr("examplePartnerTopic1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.PartnerTopicProperties{ - // ActivationState: to.Ptr(armeventgrid.PartnerTopicActivationStateActivated), - // ProvisioningState: to.Ptr(armeventgrid.PartnerTopicProvisioningStateSucceeded), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Deactivate.json -func ExamplePartnerTopicsClient_Deactivate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPartnerTopicsClient().Deactivate(ctx, "examplerg", "examplePartnerTopic1", 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.PartnerTopic = armeventgrid.PartnerTopic{ - // Name: to.Ptr("examplePartnerTopic1"), - // Type: to.Ptr("Microsoft.EventGrid/partnerTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerTopics/examplePartnerTopic1"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.PartnerTopicProperties{ - // ActivationState: to.Ptr(armeventgrid.PartnerTopicActivationStateDeactivated), - // ProvisioningState: to.Ptr(armeventgrid.PartnerTopicProvisioningStateSucceeded), - // Source: to.Ptr("ContosoCorp.Accounts.User1"), - // }, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client.go index 248e065778aa..fbd705c8fe04 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client.go @@ -45,7 +45,7 @@ func NewPermissionBindingsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Create or update a permission binding with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - permissionBindingName - The permission binding name. @@ -73,7 +73,7 @@ func (client *PermissionBindingsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create or update a permission binding with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PermissionBindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, permissionBindingInfo PermissionBinding, options *PermissionBindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PermissionBindingsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *PermissionBindingsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, permissionBindingInfo); err != nil { @@ -131,7 +131,7 @@ func (client *PermissionBindingsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Delete an existing permission binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - permissionBindingName - Name of the permission binding. @@ -158,7 +158,7 @@ func (client *PermissionBindingsClient) BeginDelete(ctx context.Context, resourc // Delete - Delete an existing permission binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PermissionBindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, options *PermissionBindingsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PermissionBindingsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *PermissionBindingsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *PermissionBindingsClient) deleteCreateRequest(ctx context.Context, // Get - Get properties of a permission binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - permissionBindingName - Name of the permission binding. @@ -264,7 +264,7 @@ func (client *PermissionBindingsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *PermissionBindingsClient) getHandleResponse(resp *http.Response) ( // NewListByNamespacePager - Get all the permission bindings under a namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - PermissionBindingsClientListByNamespaceOptions contains the optional parameters for the PermissionBindingsClient.NewListByNamespacePager @@ -335,7 +335,7 @@ func (client *PermissionBindingsClient) listByNamespaceCreateRequest(ctx context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client_example_test.go deleted file mode 100644 index 3db3c82e4862..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client_example_test.go +++ /dev/null @@ -1,153 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_Get.json -func ExamplePermissionBindingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPermissionBindingsClient().Get(ctx, "examplerg", "exampleNamespaceName1", "examplePermissionBindingName1", 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.PermissionBinding = armeventgrid.PermissionBinding{ - // Name: to.Ptr("examplePermissionBindingName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/permissionBindings"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/permissionBindings/examplePermissionBindingName1"), - // Properties: &armeventgrid.PermissionBindingProperties{ - // ClientGroupName: to.Ptr("exampleClientGroupName1"), - // Permission: to.Ptr(armeventgrid.PermissionTypePublisher), - // ProvisioningState: to.Ptr(armeventgrid.PermissionBindingProvisioningStateSucceeded), - // TopicSpaceName: to.Ptr("exampleTopicSpaceName1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_CreateOrUpdate.json -func ExamplePermissionBindingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPermissionBindingsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleNamespaceName1", "examplePermissionBindingName1", armeventgrid.PermissionBinding{ - Properties: &armeventgrid.PermissionBindingProperties{ - ClientGroupName: to.Ptr("exampleClientGroupName1"), - Permission: to.Ptr(armeventgrid.PermissionTypePublisher), - TopicSpaceName: to.Ptr("exampleTopicSpaceName1"), - }, - }, 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.PermissionBinding = armeventgrid.PermissionBinding{ - // Name: to.Ptr("examplePermissionBindingName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/permissionBindings"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/permissionBindings/examplePermissionBindingName1"), - // Properties: &armeventgrid.PermissionBindingProperties{ - // ClientGroupName: to.Ptr("exampleClientGroupName1"), - // Permission: to.Ptr(armeventgrid.PermissionTypePublisher), - // ProvisioningState: to.Ptr(armeventgrid.PermissionBindingProvisioningStateSucceeded), - // TopicSpaceName: to.Ptr("exampleTopicSpaceName1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_Delete.json -func ExamplePermissionBindingsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPermissionBindingsClient().BeginDelete(ctx, "examplerg", "exampleNamespaceName1", "examplePermissionBindingName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_ListByNamespace.json -func ExamplePermissionBindingsClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPermissionBindingsClient().NewListByNamespacePager("examplerg", "namespace123", &armeventgrid.PermissionBindingsClientListByNamespaceOptions{Filter: nil, - Top: 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.PermissionBindingsListResult = armeventgrid.PermissionBindingsListResult{ - // Value: []*armeventgrid.PermissionBinding{ - // { - // Name: to.Ptr("examplePermissionBindingName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/permissionBindings"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/permissionBindings/examplePermissionBindingName1"), - // Properties: &armeventgrid.PermissionBindingProperties{ - // ClientGroupName: to.Ptr("exampleClientGroupName1"), - // Permission: to.Ptr(armeventgrid.PermissionTypePublisher), - // ProvisioningState: to.Ptr(armeventgrid.PermissionBindingProvisioningStateSucceeded), - // TopicSpaceName: to.Ptr("exampleTopicSpaceName1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go b/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go index 03f03b0c2a21..ffa3d6d366a8 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go @@ -166,6 +166,8 @@ func unmarshalEventSubscriptionDestinationClassification(rawMsg json.RawMessage) b = &MonitorAlertEventSubscriptionDestination{} case string(EndpointTypeNamespaceTopic): b = &NamespaceTopicEventSubscriptionDestination{} + case string(EndpointTypePartnerDestination): + b = &PartnerEventSubscriptionDestination{} case string(EndpointTypeServiceBusQueue): b = &ServiceBusQueueEventSubscriptionDestination{} case string(EndpointTypeServiceBusTopic): @@ -280,6 +282,69 @@ func unmarshalInputSchemaMappingClassification(rawMsg json.RawMessage) (InputSch return b, nil } +func unmarshalPartnerClientAuthenticationClassification(rawMsg json.RawMessage) (PartnerClientAuthenticationClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PartnerClientAuthenticationClassification + switch m["clientAuthenticationType"] { + case string(PartnerClientAuthenticationTypeAzureAD): + b = &AzureADPartnerClientAuthentication{} + default: + b = &PartnerClientAuthentication{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalPartnerDestinationInfoClassification(rawMsg json.RawMessage) (PartnerDestinationInfoClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PartnerDestinationInfoClassification + switch m["endpointType"] { + case string(PartnerEndpointTypeWebHook): + b = &WebhookPartnerDestinationInfo{} + default: + b = &PartnerDestinationInfo{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalPartnerUpdateDestinationInfoClassification(rawMsg json.RawMessage) (PartnerUpdateDestinationInfoClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PartnerUpdateDestinationInfoClassification + switch m["endpointType"] { + case string(PartnerEndpointTypeWebHook): + b = &WebhookUpdatePartnerDestinationInfo{} + default: + b = &PartnerUpdateDestinationInfo{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalStaticRoutingEnrichmentClassification(rawMsg json.RawMessage) (StaticRoutingEnrichmentClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go index cb79f649cd1e..cf60abd2afe6 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go @@ -45,7 +45,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Delete a specific private endpoint connection under a topic, domain, or partner namespace or namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\' or \'namespaces\'. // - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or @@ -73,7 +73,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Delete a specific private endpoint connection under a topic, domain, or partner namespace or namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -123,7 +123,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -131,7 +131,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Get a specific private endpoint connection under a topic, domain, or partner namespace or namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\' or \'namespaces\'. // - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or @@ -189,7 +189,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +206,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByResourcePager - Get all private endpoint connections under a topic, domain, or partner namespace or namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\' or \'namespaces\'. // - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or @@ -266,7 +266,7 @@ func (client *PrivateEndpointConnectionsClient) listByResourceCreateRequest(ctx if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *PrivateEndpointConnectionsClient) listByResourceHandleResponse(res // BeginUpdate - Update a specific private endpoint connection under a topic, domain or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\' or \'namespaces\'. // - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or @@ -313,7 +313,7 @@ func (client *PrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, // Update - Update a specific private endpoint connection under a topic, domain or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginUpdate" @@ -363,7 +363,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client_example_test.go deleted file mode 100644 index 13916a133d59..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,176 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateEndpointConnections_Get.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "examplerg", armeventgrid.PrivateEndpointConnectionsParentTypeTopics, "exampletopic1", "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", 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.PrivateEndpointConnection = armeventgrid.PrivateEndpointConnection{ - // Name: to.Ptr("BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B"), - // Type: to.Ptr("Microsoft.EventGrid/topics/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/5B4B650E-28B9-4790-B3AB-DDBD88D727C4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/privateEndpointConnections/BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B"), - // Properties: &armeventgrid.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("topic")}, - // PrivateEndpoint: &armeventgrid.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/bmtpe5"), - // }, - // PrivateLinkServiceConnectionState: &armeventgrid.ConnectionState{ - // Description: to.Ptr("Test"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armeventgrid.PersistedConnectionStatusPending), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateEndpointConnections_Update.json -func ExamplePrivateEndpointConnectionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginUpdate(ctx, "examplerg", armeventgrid.PrivateEndpointConnectionsParentTypeTopics, "exampletopic1", "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", armeventgrid.PrivateEndpointConnection{ - Properties: &armeventgrid.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armeventgrid.ConnectionState{ - Description: to.Ptr("approving connection"), - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armeventgrid.PersistedConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnection = armeventgrid.PrivateEndpointConnection{ - // Name: to.Ptr("BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B"), - // Type: to.Ptr("Microsoft.EventGrid/topics/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/5B4B650E-28B9-4790-B3AB-DDBD88D727C4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/privateEndpointConnections/BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B"), - // Properties: &armeventgrid.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("topic")}, - // PrivateEndpoint: &armeventgrid.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/bmtpe5"), - // }, - // PrivateLinkServiceConnectionState: &armeventgrid.ConnectionState{ - // Description: to.Ptr("approving connection"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armeventgrid.PersistedConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateEndpointConnections_Delete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "examplerg", armeventgrid.PrivateEndpointConnectionsParentTypeTopics, "exampletopic1", "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateEndpointConnections_ListByResource.json -func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByResourcePager("examplerg", armeventgrid.PrivateEndpointConnectionsParentTypeTopics, "exampletopic1", &armeventgrid.PrivateEndpointConnectionsClientListByResourceOptions{Filter: nil, - Top: 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.PrivateEndpointConnectionListResult = armeventgrid.PrivateEndpointConnectionListResult{ - // Value: []*armeventgrid.PrivateEndpointConnection{ - // { - // Name: to.Ptr("BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B"), - // Type: to.Ptr("Microsoft.EventGrid/topics/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/5B4B650E-28B9-4790-B3AB-DDBD88D727C4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1/privateEndpointConnections/BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B"), - // Properties: &armeventgrid.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("topic")}, - // PrivateEndpoint: &armeventgrid.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/bmtpe5"), - // }, - // PrivateLinkServiceConnectionState: &armeventgrid.ConnectionState{ - // Description: to.Ptr("Test"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armeventgrid.PersistedConnectionStatusPending), - // }, - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client.go index a326cf5fd114..87f5db0dc094 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client.go @@ -45,7 +45,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Get properties of a private link resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\' or \'namespaces\'. // - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name or @@ -103,7 +103,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +120,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByResourcePager - List all the private link resources under a topic, domain, or partner namespace or namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\' or \'namespaces\'. // - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace or namespace @@ -180,7 +180,7 @@ func (client *PrivateLinkResourcesClient) listByResourceCreateRequest(ctx contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client_example_test.go deleted file mode 100644 index 3d25ace6feec..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,94 +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 armeventgrid_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateLinkResources_Get.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "examplerg", "topics", "exampletopic1", "topic", 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.PrivateLinkResource = armeventgrid.PrivateLinkResource{ - // Name: to.Ptr("topic"), - // Type: to.Ptr("Microsoft.EventGrid/topics/privateLinkResources"), - // ID: to.Ptr("/subscriptions/5B4B650E-28B9-4790-B3AB-DDBD88D727C4/resourceGroups/amh/providers/Microsoft.EventGrid/topics/exampletopic1/privateLinkResources/topic"), - // Properties: &armeventgrid.PrivateLinkResourceProperties{ - // DisplayName: to.Ptr("Event Grid topic"), - // GroupID: to.Ptr("topic"), - // RequiredMembers: []*string{ - // to.Ptr("topic")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.eventgrid.azure.net")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateLinkResources_ListByResource.json -func ExamplePrivateLinkResourcesClient_NewListByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListByResourcePager("examplerg", "topics", "exampletopic1", &armeventgrid.PrivateLinkResourcesClientListByResourceOptions{Filter: nil, - Top: 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.PrivateLinkResourcesListResult = armeventgrid.PrivateLinkResourcesListResult{ - // Value: []*armeventgrid.PrivateLinkResource{ - // { - // Name: to.Ptr("topic"), - // Type: to.Ptr("Microsoft.EventGrid/topics/privateLinkResources"), - // ID: to.Ptr("/subscriptions/5B4B650E-28B9-4790-B3AB-DDBD88D727C4/resourceGroups/amh/providers/Microsoft.EventGrid/topics/exampletopic1/privateLinkResources/topic"), - // Properties: &armeventgrid.PrivateLinkResourceProperties{ - // DisplayName: to.Ptr("Event Grid topic"), - // GroupID: to.Ptr("topic"), - // RequiredMembers: []*string{ - // to.Ptr("topic")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.eventgrid.azure.net")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/responses.go b/sdk/resourcemanager/eventgrid/armeventgrid/responses.go index e815fd744d79..43eb4d606c73 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/responses.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/responses.go @@ -496,6 +496,24 @@ type NamespacesClientValidateCustomDomainOwnershipResponse struct { CustomDomainOwnershipValidationResult } +// NetworkSecurityPerimeterConfigurationsClientGetResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.Get. +type NetworkSecurityPerimeterConfigurationsClientGetResponse struct { + // Network security perimeter configuration. + NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationsClientListResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.NewListPager. +type NetworkSecurityPerimeterConfigurationsClientListResponse struct { + // Network security perimeter configuration List. + NetworkSecurityPerimeterConfigurationList +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile. +type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct { + // Network security perimeter configuration. + NetworkSecurityPerimeterConfiguration +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // Result of the List Operations operation @@ -549,6 +567,47 @@ type PartnerConfigurationsClientUpdateResponse struct { PartnerConfiguration } +// PartnerDestinationsClientActivateResponse contains the response from method PartnerDestinationsClient.Activate. +type PartnerDestinationsClientActivateResponse struct { + // Event Grid Partner Destination. + PartnerDestination +} + +// PartnerDestinationsClientCreateOrUpdateResponse contains the response from method PartnerDestinationsClient.BeginCreateOrUpdate. +type PartnerDestinationsClientCreateOrUpdateResponse struct { + // Event Grid Partner Destination. + PartnerDestination +} + +// PartnerDestinationsClientDeleteResponse contains the response from method PartnerDestinationsClient.BeginDelete. +type PartnerDestinationsClientDeleteResponse struct { + // placeholder for future response values +} + +// PartnerDestinationsClientGetResponse contains the response from method PartnerDestinationsClient.Get. +type PartnerDestinationsClientGetResponse struct { + // Event Grid Partner Destination. + PartnerDestination +} + +// PartnerDestinationsClientListByResourceGroupResponse contains the response from method PartnerDestinationsClient.NewListByResourceGroupPager. +type PartnerDestinationsClientListByResourceGroupResponse struct { + // Result of the List Partner Destinations operation. + PartnerDestinationsListResult +} + +// PartnerDestinationsClientListBySubscriptionResponse contains the response from method PartnerDestinationsClient.NewListBySubscriptionPager. +type PartnerDestinationsClientListBySubscriptionResponse struct { + // Result of the List Partner Destinations operation. + PartnerDestinationsListResult +} + +// PartnerDestinationsClientUpdateResponse contains the response from method PartnerDestinationsClient.BeginUpdate. +type PartnerDestinationsClientUpdateResponse struct { + // Event Grid Partner Destination. + PartnerDestination +} + // PartnerNamespacesClientCreateOrUpdateResponse contains the response from method PartnerNamespacesClient.BeginCreateOrUpdate. type PartnerNamespacesClientCreateOrUpdateResponse struct { // EventGrid Partner Namespace. diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go index 5a2789fa92ca..11611c6c107b 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go @@ -46,7 +46,7 @@ func NewSystemTopicEventSubscriptionsClient(subscriptionID string, credential az // subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 64 @@ -75,7 +75,7 @@ func (client *SystemTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx conte // subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *SystemTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *SystemTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SystemTopicEventSubscriptionsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *SystemTopicEventSubscriptionsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionInfo); err != nil { @@ -133,7 +133,7 @@ func (client *SystemTopicEventSubscriptionsClient) createOrUpdateCreateRequest(c // BeginDelete - Delete an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - eventSubscriptionName - Name of the event subscription to be deleted. @@ -159,7 +159,7 @@ func (client *SystemTopicEventSubscriptionsClient) BeginDelete(ctx context.Conte // Delete - Delete an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *SystemTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, options *SystemTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SystemTopicEventSubscriptionsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *SystemTopicEventSubscriptionsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -213,7 +213,7 @@ func (client *SystemTopicEventSubscriptionsClient) deleteCreateRequest(ctx conte // Get - Get an event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - eventSubscriptionName - Name of the event subscription to be found. @@ -265,7 +265,7 @@ func (client *SystemTopicEventSubscriptionsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *SystemTopicEventSubscriptionsClient) getHandleResponse(resp *http. // GetDeliveryAttributes - Get all delivery attributes for an event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - eventSubscriptionName - Name of the event subscription. @@ -335,7 +335,7 @@ func (client *SystemTopicEventSubscriptionsClient) getDeliveryAttributesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +353,7 @@ func (client *SystemTopicEventSubscriptionsClient) getDeliveryAttributesHandleRe // GetFullURL - Get the full endpoint URL for an event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - eventSubscriptionName - Name of the event subscription. @@ -405,7 +405,7 @@ func (client *SystemTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +422,7 @@ func (client *SystemTopicEventSubscriptionsClient) getFullURLHandleResponse(resp // NewListBySystemTopicPager - List event subscriptions that belong to a specific system topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - options - SystemTopicEventSubscriptionsClientListBySystemTopicOptions contains the optional parameters for the SystemTopicEventSubscriptionsClient.NewListBySystemTopicPager @@ -476,7 +476,7 @@ func (client *SystemTopicEventSubscriptionsClient) listBySystemTopicCreateReques if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,7 +494,7 @@ func (client *SystemTopicEventSubscriptionsClient) listBySystemTopicHandleRespon // BeginUpdate - Update an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - eventSubscriptionName - Name of the event subscription to be updated. @@ -521,7 +521,7 @@ func (client *SystemTopicEventSubscriptionsClient) BeginUpdate(ctx context.Conte // Update - Update an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *SystemTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *SystemTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "SystemTopicEventSubscriptionsClient.BeginUpdate" @@ -567,7 +567,7 @@ func (client *SystemTopicEventSubscriptionsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client_example_test.go deleted file mode 100644 index 904d267522dc..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client_example_test.go +++ /dev/null @@ -1,321 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopicEventSubscriptions_Get.json -func ExampleSystemTopicEventSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSystemTopicEventSubscriptionsClient().Get(ctx, "examplerg", "exampleSystemTopic1", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopicEventSubscriptions_CreateOrUpdate.json -func ExampleSystemTopicEventSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSystemTopicEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleSystemTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopicEventSubscriptions_Delete.json -func ExampleSystemTopicEventSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSystemTopicEventSubscriptionsClient().BeginDelete(ctx, "examplerg", "exampleSystemTopic1", "examplesubscription1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopicEventSubscriptions_Update.json -func ExampleSystemTopicEventSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSystemTopicEventSubscriptionsClient().BeginUpdate(ctx, "examplerg", "exampleSystemTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopicEventSubscriptions_GetFullUrl.json -func ExampleSystemTopicEventSubscriptionsClient_GetFullURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSystemTopicEventSubscriptionsClient().GetFullURL(ctx, "examplerg", "exampleSystemTopic1", "examplesubscription1", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopicEventSubscriptions_ListBySystemTopic.json -func ExampleSystemTopicEventSubscriptionsClient_NewListBySystemTopicPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSystemTopicEventSubscriptionsClient().NewListBySystemTopicPager("examplerg", "exampleSystemTopic1", &armeventgrid.SystemTopicEventSubscriptionsClientListBySystemTopicOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // SubjectBeginsWith: to.Ptr(""), - // SubjectEndsWith: to.Ptr(""), - // }, - // Labels: []*string{ - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](10), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic1"), - // }, - // }, - // { - // Name: to.Ptr("examplesubscription2"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic1/eventSubscriptions/examplesubscription2"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopicEventSubscriptions_GetDeliveryAttributes.json -func ExampleSystemTopicEventSubscriptionsClient_GetDeliveryAttributes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSystemTopicEventSubscriptionsClient().GetDeliveryAttributes(ctx, "examplerg", "exampleSystemTopic1", "examplesubscription1", 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.DeliveryAttributeListResult = armeventgrid.DeliveryAttributeListResult{ - // Value: []armeventgrid.DeliveryAttributeMappingClassification{ - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header1"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(false), - // Value: to.Ptr("NormalValue"), - // }, - // }, - // &armeventgrid.DynamicDeliveryAttributeMapping{ - // Name: to.Ptr("header2"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeDynamic), - // Properties: &armeventgrid.DynamicDeliveryAttributeMappingProperties{ - // SourceField: to.Ptr("data.foo"), - // }, - // }, - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header3"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(true), - // Value: to.Ptr("mySecretValue"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client.go index 015ecac63a91..dace9a78b8c7 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client.go @@ -45,7 +45,7 @@ func NewSystemTopicsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Asynchronously creates a new system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - systemTopicInfo - System Topic information. @@ -71,7 +71,7 @@ func (client *SystemTopicsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Asynchronously creates a new system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *SystemTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, systemTopicName string, systemTopicInfo SystemTopic, options *SystemTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SystemTopicsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *SystemTopicsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, systemTopicInfo); err != nil { @@ -125,7 +125,7 @@ func (client *SystemTopicsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete existing system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - options - SystemTopicsClientBeginDeleteOptions contains the optional parameters for the SystemTopicsClient.BeginDelete @@ -150,7 +150,7 @@ func (client *SystemTopicsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete existing system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *SystemTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, systemTopicName string, options *SystemTopicsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SystemTopicsClient.BeginDelete" @@ -192,7 +192,7 @@ func (client *SystemTopicsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -200,7 +200,7 @@ func (client *SystemTopicsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get properties of a system topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - options - SystemTopicsClientGetOptions contains the optional parameters for the SystemTopicsClient.Get method. @@ -246,7 +246,7 @@ func (client *SystemTopicsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *SystemTopicsClient) getHandleResponse(resp *http.Response) (System // NewListByResourceGroupPager - List all the system topics under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - SystemTopicsClientListByResourceGroupOptions contains the optional parameters for the SystemTopicsClient.NewListByResourceGroupPager // method. @@ -312,7 +312,7 @@ func (client *SystemTopicsClient) listByResourceGroupCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *SystemTopicsClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List all the system topics under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - SystemTopicsClientListBySubscriptionOptions contains the optional parameters for the SystemTopicsClient.NewListBySubscriptionPager // method. func (client *SystemTopicsClient) NewListBySubscriptionPager(options *SystemTopicsClientListBySubscriptionOptions) *runtime.Pager[SystemTopicsClientListBySubscriptionResponse] { @@ -373,7 +373,7 @@ func (client *SystemTopicsClient) listBySubscriptionCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -391,7 +391,7 @@ func (client *SystemTopicsClient) listBySubscriptionHandleResponse(resp *http.Re // BeginUpdate - Asynchronously updates a system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - systemTopicUpdateParameters - SystemTopic update information. @@ -417,7 +417,7 @@ func (client *SystemTopicsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Asynchronously updates a system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *SystemTopicsClient) update(ctx context.Context, resourceGroupName string, systemTopicName string, systemTopicUpdateParameters SystemTopicUpdateParameters, options *SystemTopicsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "SystemTopicsClient.BeginUpdate" @@ -459,7 +459,7 @@ func (client *SystemTopicsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, systemTopicUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client_example_test.go deleted file mode 100644 index 454b7d478ab4..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client_example_test.go +++ /dev/null @@ -1,243 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_Get.json -func ExampleSystemTopicsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSystemTopicsClient().Get(ctx, "examplerg", "exampleSystemTopic2", 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.SystemTopic = armeventgrid.SystemTopic{ - // Name: to.Ptr("exampleSystemTopic2"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.SystemTopicProperties{ - // MetricResourceID: to.Ptr("183c0fb1-17ff-47b6-ac77-5a47420ab01e"), - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // Source: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e"), - // TopicType: to.Ptr("microsoft.storage.storageaccounts"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_CreateOrUpdate.json -func ExampleSystemTopicsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSystemTopicsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleSystemTopic1", armeventgrid.SystemTopic{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armeventgrid.SystemTopicProperties{ - Source: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e"), - TopicType: to.Ptr("microsoft.storage.storageaccounts"), - }, - }, 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.SystemTopic = armeventgrid.SystemTopic{ - // Name: to.Ptr("exampleSystemTopic2"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.SystemTopicProperties{ - // MetricResourceID: to.Ptr("183c0fb1-17ff-47b6-ac77-5a47420ab01e"), - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // Source: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e"), - // TopicType: to.Ptr("microsoft.storage.storageaccounts"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_Delete.json -func ExampleSystemTopicsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSystemTopicsClient().BeginDelete(ctx, "examplerg", "exampleSystemTopic1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_Update.json -func ExampleSystemTopicsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSystemTopicsClient().BeginUpdate(ctx, "examplerg", "exampleSystemTopic1", armeventgrid.SystemTopicUpdateParameters{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.SystemTopic = armeventgrid.SystemTopic{ - // Name: to.Ptr("exampleSystemTopic2"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.SystemTopicProperties{ - // MetricResourceID: to.Ptr("183c0fb1-17ff-47b6-ac77-5a47420ab01e"), - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // Source: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e"), - // TopicType: to.Ptr("microsoft.storage.storageaccounts"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_ListBySubscription.json -func ExampleSystemTopicsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSystemTopicsClient().NewListBySubscriptionPager(&armeventgrid.SystemTopicsClientListBySubscriptionOptions{Filter: nil, - Top: 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.SystemTopicsListResult = armeventgrid.SystemTopicsListResult{ - // Value: []*armeventgrid.SystemTopic{ - // { - // Name: to.Ptr("exampleSystemTopic2"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/exampleSystemTopic2"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.SystemTopicProperties{ - // MetricResourceID: to.Ptr("183c0fb1-17ff-47b6-ac77-5a47420ab01e"), - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // Source: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e"), - // TopicType: to.Ptr("microsoft.storage.storageaccounts"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_ListByResourceGroup.json -func ExampleSystemTopicsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSystemTopicsClient().NewListByResourceGroupPager("examplerg", &armeventgrid.SystemTopicsClientListByResourceGroupOptions{Filter: nil, - Top: 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.SystemTopicsListResult = armeventgrid.SystemTopicsListResult{ - // Value: []*armeventgrid.SystemTopic{ - // { - // Name: to.Ptr("pubstgrunnerb71cd29e-86fad330-7bac-4238-8cab-9e46b75165aa"), - // Type: to.Ptr("Microsoft.EventGrid/systemTopics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/systemTopics/pubstgrunnerb71cd29e-86fad330-7bac-4238-8cab-9e46b75165aa"), - // Location: to.Ptr("centraluseuap"), - // Properties: &armeventgrid.SystemTopicProperties{ - // MetricResourceID: to.Ptr("183c0fb1-17ff-47b6-ac77-5a47420ab01e"), - // ProvisioningState: to.Ptr(armeventgrid.ResourceProvisioningStateSucceeded), - // Source: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e"), - // TopicType: to.Ptr("microsoft.storage.storageaccounts"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client.go index ffb40e18d1ed..eb9cdae79498 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client.go @@ -45,7 +45,7 @@ func NewTopicEventSubscriptionsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the domain topic. // - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 64 @@ -73,7 +73,7 @@ func (client *TopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *TopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "TopicEventSubscriptionsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *TopicEventSubscriptionsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionInfo); err != nil { @@ -131,7 +131,7 @@ func (client *TopicEventSubscriptionsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete an existing event subscription for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - eventSubscriptionName - Name of the event subscription to be deleted. @@ -157,7 +157,7 @@ func (client *TopicEventSubscriptionsClient) BeginDelete(ctx context.Context, re // Delete - Delete an existing event subscription for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TopicEventSubscriptionsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *TopicEventSubscriptionsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,7 +211,7 @@ func (client *TopicEventSubscriptionsClient) deleteCreateRequest(ctx context.Con // Get - Get properties of an event subscription of a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - eventSubscriptionName - Name of the event subscription to be found. @@ -263,7 +263,7 @@ func (client *TopicEventSubscriptionsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *TopicEventSubscriptionsClient) getHandleResponse(resp *http.Respon // GetDeliveryAttributes - Get all delivery attributes for an event subscription for topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - eventSubscriptionName - Name of the event subscription. @@ -333,7 +333,7 @@ func (client *TopicEventSubscriptionsClient) getDeliveryAttributesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *TopicEventSubscriptionsClient) getDeliveryAttributesHandleResponse // GetFullURL - Get the full endpoint URL for an event subscription for topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the domain topic. // - eventSubscriptionName - Name of the event subscription. @@ -403,7 +403,7 @@ func (client *TopicEventSubscriptionsClient) getFullURLCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -420,7 +420,7 @@ func (client *TopicEventSubscriptionsClient) getFullURLHandleResponse(resp *http // NewListPager - List all event subscriptions that have been created for a specific topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - options - TopicEventSubscriptionsClientListOptions contains the optional parameters for the TopicEventSubscriptionsClient.NewListPager @@ -474,7 +474,7 @@ func (client *TopicEventSubscriptionsClient) listCreateRequest(ctx context.Conte if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,7 +492,7 @@ func (client *TopicEventSubscriptionsClient) listHandleResponse(resp *http.Respo // BeginUpdate - Update an existing event subscription for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the domain. // - eventSubscriptionName - Name of the event subscription to be updated. @@ -519,7 +519,7 @@ func (client *TopicEventSubscriptionsClient) BeginUpdate(ctx context.Context, re // Update - Update an existing event subscription for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *TopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "TopicEventSubscriptionsClient.BeginUpdate" @@ -565,7 +565,7 @@ func (client *TopicEventSubscriptionsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client_example_test.go deleted file mode 100644 index af4599b67015..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client_example_test.go +++ /dev/null @@ -1,322 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicEventSubscriptions_GetDeliveryAttributes.json -func ExampleTopicEventSubscriptionsClient_GetDeliveryAttributes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicEventSubscriptionsClient().GetDeliveryAttributes(ctx, "examplerg", "exampleTopic1", "examplesubscription1", 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.DeliveryAttributeListResult = armeventgrid.DeliveryAttributeListResult{ - // Value: []armeventgrid.DeliveryAttributeMappingClassification{ - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header1"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(false), - // Value: to.Ptr("NormalValue"), - // }, - // }, - // &armeventgrid.DynamicDeliveryAttributeMapping{ - // Name: to.Ptr("header2"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeDynamic), - // Properties: &armeventgrid.DynamicDeliveryAttributeMappingProperties{ - // SourceField: to.Ptr("data.foo"), - // }, - // }, - // &armeventgrid.StaticDeliveryAttributeMapping{ - // Name: to.Ptr("header3"), - // Type: to.Ptr(armeventgrid.DeliveryAttributeMappingTypeStatic), - // Properties: &armeventgrid.StaticDeliveryAttributeMappingProperties{ - // IsSecret: to.Ptr(true), - // Value: to.Ptr("mySecretValue"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicEventSubscriptions_Get.json -func ExampleTopicEventSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicEventSubscriptionsClient().Get(ctx, "examplerg", "exampleTopic1", "examplesubscription1", 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/topics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicEventSubscriptions_CreateOrUpdate.json -func ExampleTopicEventSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicEventSubscriptionsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscription{ - Properties: &armeventgrid.EventSubscriptionProperties{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(false), - SubjectBeginsWith: to.Ptr("ExamplePrefix"), - SubjectEndsWith: to.Ptr("ExampleSuffix"), - }, - }, - }, 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.EventSubscription = armeventgrid.EventSubscription{ - // Name: to.Ptr("exampleEventSubscriptionName1"), - // Type: to.Ptr("Microsoft.EventGrid/topics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1/eventSubscriptions/exampleEventSubscriptionName1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - // Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - // EndpointBaseURL: to.Ptr("https://requestb.in/15ksip71"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicEventSubscriptions_Delete.json -func ExampleTopicEventSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicEventSubscriptionsClient().BeginDelete(ctx, "examplerg", "exampleTopic", "examplesubscription", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicEventSubscriptions_Update.json -func ExampleTopicEventSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicEventSubscriptionsClient().BeginUpdate(ctx, "examplerg", "exampleTopic1", "exampleEventSubscriptionName1", armeventgrid.EventSubscriptionUpdateParameters{ - Destination: &armeventgrid.WebHookEventSubscriptionDestination{ - EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), - Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ - EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - }, - }, - Filter: &armeventgrid.EventSubscriptionFilter{ - IsSubjectCaseSensitive: to.Ptr(true), - SubjectBeginsWith: to.Ptr("existingPrefix"), - SubjectEndsWith: to.Ptr("newSuffix"), - }, - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicEventSubscriptions_GetFullUrl.json -func ExampleTopicEventSubscriptionsClient_GetFullURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicEventSubscriptionsClient().GetFullURL(ctx, "examplerg", "exampleTopic1", "examplesubscription1", 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.EventSubscriptionFullURL = armeventgrid.EventSubscriptionFullURL{ - // EndpointURL: to.Ptr("https://requestb.in/15ksip71"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicEventSubscriptions_List.json -func ExampleTopicEventSubscriptionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicEventSubscriptionsClient().NewListPager("examplerg", "exampleTopic1", &armeventgrid.TopicEventSubscriptionsClientListOptions{Filter: nil, - Top: 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.EventSubscriptionsListResult = armeventgrid.EventSubscriptionsListResult{ - // Value: []*armeventgrid.EventSubscription{ - // { - // Name: to.Ptr("examplesubscription1"), - // Type: to.Ptr("Microsoft.EventGrid/topics/eventSubscriptions"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1/eventSubscriptions/examplesubscription1"), - // Properties: &armeventgrid.EventSubscriptionProperties{ - // Destination: &armeventgrid.StorageQueueEventSubscriptionDestination{ - // EndpointType: to.Ptr(armeventgrid.EndpointTypeStorageQueue), - // Properties: &armeventgrid.StorageQueueEventSubscriptionDestinationProperties{ - // QueueName: to.Ptr("que"), - // ResourceID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Storage/storageAccounts/testtrackedsource"), - // }, - // }, - // EventDeliverySchema: to.Ptr(armeventgrid.EventDeliverySchemaEventGridSchema), - // Filter: &armeventgrid.EventSubscriptionFilter{ - // IncludedEventTypes: []*string{ - // to.Ptr("Microsoft.Storage.BlobCreated"), - // to.Ptr("Microsoft.Storage.BlobDeleted")}, - // IsSubjectCaseSensitive: to.Ptr(false), - // SubjectBeginsWith: to.Ptr("ExamplePrefix"), - // SubjectEndsWith: to.Ptr("ExampleSuffix"), - // }, - // Labels: []*string{ - // to.Ptr("label1"), - // to.Ptr("label2")}, - // ProvisioningState: to.Ptr(armeventgrid.EventSubscriptionProvisioningStateSucceeded), - // RetryPolicy: &armeventgrid.RetryPolicy{ - // EventTimeToLiveInMinutes: to.Ptr[int32](1440), - // MaxDeliveryAttempts: to.Ptr[int32](30), - // }, - // Topic: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/topics_client.go index 036f35f31014..889caccdb2a8 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topics_client.go @@ -45,7 +45,7 @@ func NewTopicsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Asynchronously creates a new topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - topicInfo - Topic information. @@ -71,7 +71,7 @@ func (client *TopicsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Asynchronously creates a new topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, topicName string, topicInfo Topic, options *TopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "TopicsClient.BeginCreateOrUpdate" @@ -113,7 +113,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, topicInfo); err != nil { @@ -125,7 +125,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Delete existing topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - options - TopicsClientBeginDeleteOptions contains the optional parameters for the TopicsClient.BeginDelete method. @@ -149,7 +149,7 @@ func (client *TopicsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Delete existing topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, topicName string, options *TopicsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TopicsClient.BeginDelete" @@ -191,7 +191,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -199,7 +199,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get properties of a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - options - TopicsClientGetOptions contains the optional parameters for the TopicsClient.Get method. @@ -245,7 +245,7 @@ func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *TopicsClient) getHandleResponse(resp *http.Response) (TopicsClient // NewListByResourceGroupPager - List all the topics under a resource group. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - options - TopicsClientListByResourceGroupOptions contains the optional parameters for the TopicsClient.NewListByResourceGroupPager // method. @@ -311,7 +311,7 @@ func (client *TopicsClient) listByResourceGroupCreateRequest(ctx context.Context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *TopicsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - List all the topics under an Azure subscription. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - TopicsClientListBySubscriptionOptions contains the optional parameters for the TopicsClient.NewListBySubscriptionPager // method. func (client *TopicsClient) NewListBySubscriptionPager(options *TopicsClientListBySubscriptionOptions) *runtime.Pager[TopicsClientListBySubscriptionResponse] { @@ -372,7 +372,7 @@ func (client *TopicsClient) listBySubscriptionCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -389,7 +389,7 @@ func (client *TopicsClient) listBySubscriptionHandleResponse(resp *http.Response // NewListEventTypesPager - List event types for a topic. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - providerNamespace - Namespace of the provider of the topic. // - resourceTypeName - Name of the topic type. @@ -448,7 +448,7 @@ func (client *TopicsClient) listEventTypesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -466,7 +466,7 @@ func (client *TopicsClient) listEventTypesHandleResponse(resp *http.Response) (T // ListSharedAccessKeys - List the two keys used to publish to a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - options - TopicsClientListSharedAccessKeysOptions contains the optional parameters for the TopicsClient.ListSharedAccessKeys @@ -513,7 +513,7 @@ func (client *TopicsClient) listSharedAccessKeysCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -531,7 +531,7 @@ func (client *TopicsClient) listSharedAccessKeysHandleResponse(resp *http.Respon // BeginRegenerateKey - Regenerate a shared access key for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - regenerateKeyRequest - Request body to regenerate key. @@ -557,7 +557,7 @@ func (client *TopicsClient) BeginRegenerateKey(ctx context.Context, resourceGrou // RegenerateKey - Regenerate a shared access key for a topic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicsClient) regenerateKey(ctx context.Context, resourceGroupName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest, options *TopicsClientBeginRegenerateKeyOptions) (*http.Response, error) { var err error const operationName = "TopicsClient.BeginRegenerateKey" @@ -599,7 +599,7 @@ func (client *TopicsClient) regenerateKeyCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateKeyRequest); err != nil { @@ -611,7 +611,7 @@ func (client *TopicsClient) regenerateKeyCreateRequest(ctx context.Context, reso // BeginUpdate - Asynchronously updates a topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - topicUpdateParameters - Topic update information. @@ -636,7 +636,7 @@ func (client *TopicsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Asynchronously updates a topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicsClient) update(ctx context.Context, resourceGroupName string, topicName string, topicUpdateParameters TopicUpdateParameters, options *TopicsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "TopicsClient.BeginUpdate" @@ -678,7 +678,7 @@ func (client *TopicsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, topicUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topics_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/topics_client_example_test.go deleted file mode 100644 index 53b343898519..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topics_client_example_test.go +++ /dev/null @@ -1,369 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Get.json -func ExampleTopicsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().Get(ctx, "examplerg", "exampletopic2", 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.Topic = armeventgrid.Topic{ - // Name: to.Ptr("exampletopic2"), - // Type: to.Ptr("Microsoft.EventGrid/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.TopicProperties{ - // Endpoint: to.Ptr("https://exampletopic2.westcentralus-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.TopicProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_CreateOrUpdate.json -func ExampleTopicsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicsClient().BeginCreateOrUpdate(ctx, "examplerg", "exampletopic1", armeventgrid.Topic{ - Location: to.Ptr("westus2"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armeventgrid.TopicProperties{ - InboundIPRules: []*armeventgrid.InboundIPRule{ - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.30.15"), - }, - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.176.1"), - }}, - PublicNetworkAccess: to.Ptr(armeventgrid.PublicNetworkAccessEnabled), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Delete.json -func ExampleTopicsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicsClient().BeginDelete(ctx, "examplerg", "exampletopic", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Update.json -func ExampleTopicsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicsClient().BeginUpdate(ctx, "examplerg", "exampletopic1", armeventgrid.TopicUpdateParameters{ - Properties: &armeventgrid.TopicUpdateParameterProperties{ - InboundIPRules: []*armeventgrid.InboundIPRule{ - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.30.15"), - }, - { - Action: to.Ptr(armeventgrid.IPActionTypeAllow), - IPMask: to.Ptr("12.18.176.1"), - }}, - PublicNetworkAccess: to.Ptr(armeventgrid.PublicNetworkAccessEnabled), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListBySubscription.json -func ExampleTopicsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicsClient().NewListBySubscriptionPager(&armeventgrid.TopicsClientListBySubscriptionOptions{Filter: nil, - Top: 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.TopicsListResult = armeventgrid.TopicsListResult{ - // Value: []*armeventgrid.Topic{ - // { - // Name: to.Ptr("exampletopic1"), - // Type: to.Ptr("Microsoft.EventGrid/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1"), - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.TopicProperties{ - // Endpoint: to.Ptr("https://exampletopic1.westus2-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.TopicProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("exampletopic2"), - // Type: to.Ptr("Microsoft.EventGrid/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.TopicProperties{ - // Endpoint: to.Ptr("https://exampletopic2.westcentralus-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.TopicProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListByResourceGroup.json -func ExampleTopicsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicsClient().NewListByResourceGroupPager("examplerg", &armeventgrid.TopicsClientListByResourceGroupOptions{Filter: nil, - Top: 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.TopicsListResult = armeventgrid.TopicsListResult{ - // Value: []*armeventgrid.Topic{ - // { - // Name: to.Ptr("exampletopic1"), - // Type: to.Ptr("Microsoft.EventGrid/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1"), - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.TopicProperties{ - // Endpoint: to.Ptr("https://exampletopic1.westus2-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.TopicProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("exampletopic2"), - // Type: to.Ptr("Microsoft.EventGrid/topics"), - // ID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armeventgrid.TopicProperties{ - // Endpoint: to.Ptr("https://exampletopic2.westcentralus-1.eventgrid.azure.net/api/events"), - // ProvisioningState: to.Ptr(armeventgrid.TopicProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListSharedAccessKeys.json -func ExampleTopicsClient_ListSharedAccessKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicsClient().ListSharedAccessKeys(ctx, "examplerg", "exampletopic2", 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.TopicSharedAccessKeys = armeventgrid.TopicSharedAccessKeys{ - // Key1: to.Ptr(""), - // Key2: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_RegenerateKey.json -func ExampleTopicsClient_BeginRegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicsClient().BeginRegenerateKey(ctx, "examplerg", "exampletopic2", armeventgrid.TopicRegenerateKeyRequest{ - KeyName: to.Ptr("key1"), - }, 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.TopicSharedAccessKeys = armeventgrid.TopicSharedAccessKeys{ - // Key1: to.Ptr(""), - // Key2: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListEventTypes.json -func ExampleTopicsClient_NewListEventTypesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicsClient().NewListEventTypesPager("examplerg", "Microsoft.Storage", "storageAccounts", "ExampleStorageAccount", 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.EventTypesListResult = armeventgrid.EventTypesListResult{ - // Value: []*armeventgrid.EventType{ - // { - // Name: to.Ptr("Microsoft.Storage.BlobCreated"), - // Type: to.Ptr("Microsoft.EventGrid/topicTypes/eventTypes"), - // ID: to.Ptr("providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts/eventTypes/Microsoft.Storage.BlobCreated"), - // Properties: &armeventgrid.EventTypeProperties{ - // Description: to.Ptr("Raised when a blob is created."), - // DisplayName: to.Ptr("Blob Created"), - // SchemaURL: to.Ptr("tbd"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Storage.BlobDeleted"), - // Type: to.Ptr("Microsoft.EventGrid/topicTypes/eventTypes"), - // ID: to.Ptr("providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts/eventTypes/Microsoft.Storage.BlobDeleted"), - // Properties: &armeventgrid.EventTypeProperties{ - // Description: to.Ptr("Raised when a blob is deleted."), - // DisplayName: to.Ptr("Blob Deleted"), - // SchemaURL: to.Ptr("tbd"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client.go index 30d104038bbc..43517451d77f 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client.go @@ -45,7 +45,7 @@ func NewTopicSpacesClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Create or update a topic space with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicSpaceName - The topic space name. @@ -73,7 +73,7 @@ func (client *TopicSpacesClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create or update a topic space with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicSpacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, topicSpaceInfo TopicSpace, options *TopicSpacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "TopicSpacesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *TopicSpacesClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, topicSpaceInfo); err != nil { @@ -131,7 +131,7 @@ func (client *TopicSpacesClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Delete an existing topic space. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicSpaceName - Name of the Topic space. @@ -157,7 +157,7 @@ func (client *TopicSpacesClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Delete an existing topic space. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview func (client *TopicSpacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, options *TopicSpacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TopicSpacesClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *TopicSpacesClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *TopicSpacesClient) deleteCreateRequest(ctx context.Context, resour // Get - Get properties of a topic space. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - topicSpaceName - Name of the Topic space. @@ -263,7 +263,7 @@ func (client *TopicSpacesClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *TopicSpacesClient) getHandleResponse(resp *http.Response) (TopicSp // NewListByNamespacePager - Get all the topic spaces under a namespace. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - namespaceName - Name of the namespace. // - options - TopicSpacesClientListByNamespaceOptions contains the optional parameters for the TopicSpacesClient.NewListByNamespacePager @@ -334,7 +334,7 @@ func (client *TopicSpacesClient) listByNamespaceCreateRequest(ctx context.Contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client_example_test.go deleted file mode 100644 index 857d43002bc6..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client_example_test.go +++ /dev/null @@ -1,153 +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 armeventgrid_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/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_Get.json -func ExampleTopicSpacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicSpacesClient().Get(ctx, "examplerg", "exampleNamespaceName1", "exampleTopicSpaceName1", 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.TopicSpace = armeventgrid.TopicSpace{ - // Name: to.Ptr("exampleTopicSpaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topicSpaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/topicSpaces/exampleTopicSpaceName1"), - // Properties: &armeventgrid.TopicSpaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.TopicSpaceProvisioningStateSucceeded), - // TopicTemplates: []*string{ - // to.Ptr("filter1"), - // to.Ptr("filter2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_CreateOrUpdate.json -func ExampleTopicSpacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicSpacesClient().BeginCreateOrUpdate(ctx, "examplerg", "exampleNamespaceName1", "exampleTopicSpaceName1", armeventgrid.TopicSpace{ - Properties: &armeventgrid.TopicSpaceProperties{ - TopicTemplates: []*string{ - to.Ptr("filter1"), - to.Ptr("filter2")}, - }, - }, 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.TopicSpace = armeventgrid.TopicSpace{ - // Name: to.Ptr("exampleTopicSpaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topicSpaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/topicSpaces/exampleTopicSpaceName1"), - // Properties: &armeventgrid.TopicSpaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.TopicSpaceProvisioningStateSucceeded), - // TopicTemplates: []*string{ - // to.Ptr("filter1"), - // to.Ptr("filter2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_Delete.json -func ExampleTopicSpacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTopicSpacesClient().BeginDelete(ctx, "examplerg", "exampleNamespaceName1", "exampleTopicSpaceName1", 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/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_ListByNamespace.json -func ExampleTopicSpacesClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicSpacesClient().NewListByNamespacePager("examplerg", "namespace123", &armeventgrid.TopicSpacesClientListByNamespaceOptions{Filter: nil, - Top: 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.TopicSpacesListResult = armeventgrid.TopicSpacesListResult{ - // Value: []*armeventgrid.TopicSpace{ - // { - // Name: to.Ptr("exampleTopicSpaceName1"), - // Type: to.Ptr("Microsoft.EventGrid/namespaces/topicSpaces"), - // ID: to.Ptr("/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/topicSpaces/exampleTopicSpaceName1"), - // Properties: &armeventgrid.TopicSpaceProperties{ - // ProvisioningState: to.Ptr(armeventgrid.TopicSpaceProvisioningStateSucceeded), - // TopicTemplates: []*string{ - // to.Ptr("filter1"), - // to.Ptr("filter2")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go index 2e67e1bb9574..130169c1d076 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go @@ -40,7 +40,7 @@ func NewTopicTypesClient(credential azcore.TokenCredential, options *arm.ClientO // Get - Get information about a topic type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - topicTypeName - Name of the topic type. // - options - TopicTypesClientGetOptions contains the optional parameters for the TopicTypesClient.Get method. func (client *TopicTypesClient) Get(ctx context.Context, topicTypeName string, options *TopicTypesClientGetOptions) (TopicTypesClientGetResponse, error) { @@ -77,7 +77,7 @@ func (client *TopicTypesClient) getCreateRequest(ctx context.Context, topicTypeN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -94,7 +94,7 @@ func (client *TopicTypesClient) getHandleResponse(resp *http.Response) (TopicTyp // NewListPager - List all registered topic types. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - TopicTypesClientListOptions contains the optional parameters for the TopicTypesClient.NewListPager method. func (client *TopicTypesClient) NewListPager(options *TopicTypesClientListOptions) *runtime.Pager[TopicTypesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TopicTypesClientListResponse]{ @@ -128,7 +128,7 @@ func (client *TopicTypesClient) listCreateRequest(ctx context.Context, _ *TopicT return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -145,7 +145,7 @@ func (client *TopicTypesClient) listHandleResponse(resp *http.Response) (TopicTy // NewListEventTypesPager - List event types for a topic type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - topicTypeName - Name of the topic type. // - options - TopicTypesClientListEventTypesOptions contains the optional parameters for the TopicTypesClient.NewListEventTypesPager // method. @@ -185,7 +185,7 @@ func (client *TopicTypesClient) listEventTypesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client_example_test.go deleted file mode 100644 index 5a49b04d63b1..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client_example_test.go +++ /dev/null @@ -1,150 +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 armeventgrid_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_List.json -func ExampleTopicTypesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicTypesClient().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.TopicTypesListResult = armeventgrid.TopicTypesListResult{ - // Value: []*armeventgrid.TopicTypeInfo{ - // { - // Name: to.Ptr("Microsoft.Eventhub.Namespaces"), - // Type: to.Ptr("Microsoft.EventGrid/topicTypes"), - // ID: to.Ptr("providers/Microsoft.EventGrid/topicTypes/Microsoft.Eventhub.Namespaces"), - // Properties: &armeventgrid.TopicTypeProperties{ - // Description: to.Ptr("Microsoft EventHubs service events."), - // DisplayName: to.Ptr("EventHubs Namespace"), - // Provider: to.Ptr("Microsoft.Eventhub"), - // ProvisioningState: to.Ptr(armeventgrid.TopicTypeProvisioningStateSucceeded), - // ResourceRegionType: to.Ptr(armeventgrid.ResourceRegionTypeRegionalResource), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Storage.StorageAccounts"), - // Type: to.Ptr("Microsoft.EventGrid/topicTypes"), - // ID: to.Ptr("providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts"), - // Properties: &armeventgrid.TopicTypeProperties{ - // Description: to.Ptr("Microsoft Storage service events."), - // DisplayName: to.Ptr("Storage Accounts"), - // Provider: to.Ptr("Microsoft.Storage"), - // ProvisioningState: to.Ptr(armeventgrid.TopicTypeProvisioningStateSucceeded), - // ResourceRegionType: to.Ptr(armeventgrid.ResourceRegionTypeRegionalResource), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_Get.json -func ExampleTopicTypesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopicTypesClient().Get(ctx, "Microsoft.Storage.StorageAccounts", 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.TopicTypeInfo = armeventgrid.TopicTypeInfo{ - // Name: to.Ptr("Microsoft.Storage.StorageAccounts"), - // Type: to.Ptr("Microsoft.EventGrid/topicTypes"), - // ID: to.Ptr("providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts"), - // Properties: &armeventgrid.TopicTypeProperties{ - // Description: to.Ptr("Microsoft Storage service events."), - // DisplayName: to.Ptr("Storage Accounts"), - // Provider: to.Ptr("Microsoft.Storage"), - // ProvisioningState: to.Ptr(armeventgrid.TopicTypeProvisioningStateSucceeded), - // ResourceRegionType: to.Ptr(armeventgrid.ResourceRegionTypeRegionalResource), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_ListEventTypes.json -func ExampleTopicTypesClient_NewListEventTypesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopicTypesClient().NewListEventTypesPager("Microsoft.Storage.StorageAccounts", 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.EventTypesListResult = armeventgrid.EventTypesListResult{ - // Value: []*armeventgrid.EventType{ - // { - // Name: to.Ptr("Microsoft.Storage.BlobCreated"), - // Type: to.Ptr("Microsoft.EventGrid/topicTypes/eventTypes"), - // ID: to.Ptr("providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts/eventTypes/Microsoft.Storage.BlobCreated"), - // Properties: &armeventgrid.EventTypeProperties{ - // Description: to.Ptr("Raised when a blob is created."), - // DisplayName: to.Ptr("Blob Created"), - // SchemaURL: to.Ptr("tbd"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Storage.BlobDeleted"), - // Type: to.Ptr("Microsoft.EventGrid/topicTypes/eventTypes"), - // ID: to.Ptr("providers/Microsoft.EventGrid/topicTypes/Microsoft.Storage.StorageAccounts/eventTypes/Microsoft.Storage.BlobDeleted"), - // Properties: &armeventgrid.EventTypeProperties{ - // Description: to.Ptr("Raised when a blob is deleted."), - // DisplayName: to.Ptr("Blob Deleted"), - // SchemaURL: to.Ptr("tbd"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client.go index 755ba312efc6..0975d47737e2 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client.go @@ -41,7 +41,7 @@ func NewVerifiedPartnersClient(credential azcore.TokenCredential, options *arm.C // Get - Get properties of a verified partner. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - verifiedPartnerName - Name of the verified partner. // - options - VerifiedPartnersClientGetOptions contains the optional parameters for the VerifiedPartnersClient.Get method. func (client *VerifiedPartnersClient) Get(ctx context.Context, verifiedPartnerName string, options *VerifiedPartnersClientGetOptions) (VerifiedPartnersClientGetResponse, error) { @@ -78,7 +78,7 @@ func (client *VerifiedPartnersClient) getCreateRequest(ctx context.Context, veri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -95,7 +95,7 @@ func (client *VerifiedPartnersClient) getHandleResponse(resp *http.Response) (Ve // NewListPager - Get a list of all verified partners. // -// Generated from API version 2025-02-15 +// Generated from API version 2025-04-01-preview // - options - VerifiedPartnersClientListOptions contains the optional parameters for the VerifiedPartnersClient.NewListPager // method. func (client *VerifiedPartnersClient) NewListPager(options *VerifiedPartnersClientListOptions) *runtime.Pager[VerifiedPartnersClientListResponse] { @@ -135,7 +135,7 @@ func (client *VerifiedPartnersClient) listCreateRequest(ctx context.Context, opt if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2025-02-15") + reqQP.Set("api-version", "2025-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client_example_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client_example_test.go deleted file mode 100644 index 5039cd263a6a..000000000000 --- a/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client_example_test.go +++ /dev/null @@ -1,98 +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 armeventgrid_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/VerifiedPartners_Get.json -func ExampleVerifiedPartnersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVerifiedPartnersClient().Get(ctx, "Contoso.Finance", 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.VerifiedPartner = armeventgrid.VerifiedPartner{ - // Name: to.Ptr("Contoso.Finance"), - // Type: to.Ptr("Microsoft.EventGrid/verifiedPartners"), - // ID: to.Ptr("/providers/Microsoft.EventGrid/verifiedPartners/Contoso.Finance"), - // Properties: &armeventgrid.VerifiedPartnerProperties{ - // OrganizationName: to.Ptr("Contoso"), - // PartnerDisplayName: to.Ptr("Contoso - Finance Department"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // PartnerTopicDetails: &armeventgrid.PartnerDetails{ - // Description: to.Ptr("This is short description"), - // LongDescription: to.Ptr("This is really long long... long description"), - // SetupURI: to.Ptr("https://www.example.com/"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ee1eec42dcc710ff88db2d1bf574b2f9afe3d654/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/VerifiedPartners_List.json -func ExampleVerifiedPartnersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armeventgrid.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVerifiedPartnersClient().NewListPager(&armeventgrid.VerifiedPartnersClientListOptions{Filter: nil, - Top: 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.VerifiedPartnersListResult = armeventgrid.VerifiedPartnersListResult{ - // Value: []*armeventgrid.VerifiedPartner{ - // { - // Name: to.Ptr("Contoso.Finance"), - // Type: to.Ptr("Microsoft.EventGrid/verifiedPartners"), - // ID: to.Ptr("/providers/Microsoft.EventGrid/verifiedPartners/Contoso.Finance"), - // Properties: &armeventgrid.VerifiedPartnerProperties{ - // OrganizationName: to.Ptr("Contoso"), - // PartnerDisplayName: to.Ptr("Contoso - Finance Department"), - // PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), - // PartnerTopicDetails: &armeventgrid.PartnerDetails{ - // Description: to.Ptr("This is short description"), - // LongDescription: to.Ptr("This is really long long... long description"), - // SetupURI: to.Ptr("https://www.example.com/"), - // }, - // }, - // }}, - // } - } -}