diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md b/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md index 575eb3c12910..c0bc938d3eac 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md +++ b/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md @@ -1,5 +1,233 @@ # Release History +## 2.2.0-beta.1 (2023-05-16) +### 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 `PrivateEndpointConnectionsParentTypeNamespaces` added to enum type `PrivateEndpointConnectionsParentType` +- New enum type `AlternativeAuthenticationNameSource` with values `AlternativeAuthenticationNameSourceClientCertificateDNS`, `AlternativeAuthenticationNameSourceClientCertificateEmail`, `AlternativeAuthenticationNameSourceClientCertificateIP`, `AlternativeAuthenticationNameSourceClientCertificateSubject`, `AlternativeAuthenticationNameSourceClientCertificateURI` +- New enum type `CaCertificateProvisioningState` with values `CaCertificateProvisioningStateCanceled`, `CaCertificateProvisioningStateCreating`, `CaCertificateProvisioningStateDeleted`, `CaCertificateProvisioningStateDeleting`, `CaCertificateProvisioningStateFailed`, `CaCertificateProvisioningStateSucceeded`, `CaCertificateProvisioningStateUpdating` +- New enum type `ClientCertificateValidationScheme` with values `ClientCertificateValidationSchemeDNSMatchesAuthenticationName`, `ClientCertificateValidationSchemeEmailMatchesAuthenticationName`, `ClientCertificateValidationSchemeIPMatchesAuthenticationName`, `ClientCertificateValidationSchemeSubjectMatchesAuthenticationName`, `ClientCertificateValidationSchemeThumbprintMatch`, `ClientCertificateValidationSchemeURIMatchesAuthenticationName` +- New enum type `ClientGroupProvisioningState` with values `ClientGroupProvisioningStateCanceled`, `ClientGroupProvisioningStateCreating`, `ClientGroupProvisioningStateDeleted`, `ClientGroupProvisioningStateDeleting`, `ClientGroupProvisioningStateFailed`, `ClientGroupProvisioningStateSucceeded`, `ClientGroupProvisioningStateUpdating` +- New enum type `ClientProvisioningState` with values `ClientProvisioningStateCanceled`, `ClientProvisioningStateCreating`, `ClientProvisioningStateDeleted`, `ClientProvisioningStateDeleting`, `ClientProvisioningStateFailed`, `ClientProvisioningStateSucceeded`, `ClientProvisioningStateUpdating` +- New enum type `ClientState` with values `ClientStateDisabled`, `ClientStateEnabled` +- New enum type `DeliveryMode` with values `DeliveryModeQueue` +- New enum type `DeliverySchema` with values `DeliverySchemaCloudEventSchemaV10` +- New enum type `EventInputSchema` with values `EventInputSchemaCloudEventSchemaV10` +- New enum type `FilterOperatorType` with values `FilterOperatorTypeBoolEquals`, `FilterOperatorTypeIsNotNull`, `FilterOperatorTypeIsNullOrUndefined`, `FilterOperatorTypeNumberGreaterThan`, `FilterOperatorTypeNumberGreaterThanOrEquals`, `FilterOperatorTypeNumberIn`, `FilterOperatorTypeNumberInRange`, `FilterOperatorTypeNumberLessThan`, `FilterOperatorTypeNumberLessThanOrEquals`, `FilterOperatorTypeNumberNotIn`, `FilterOperatorTypeNumberNotInRange`, `FilterOperatorTypeStringBeginsWith`, `FilterOperatorTypeStringContains`, `FilterOperatorTypeStringEndsWith`, `FilterOperatorTypeStringIn`, `FilterOperatorTypeStringNotBeginsWith`, `FilterOperatorTypeStringNotContains`, `FilterOperatorTypeStringNotEndsWith`, `FilterOperatorTypeStringNotIn` +- New enum type `NamespaceProvisioningState` with values `NamespaceProvisioningStateCanceled`, `NamespaceProvisioningStateCreateFailed`, `NamespaceProvisioningStateCreating`, `NamespaceProvisioningStateDeleteFailed`, `NamespaceProvisioningStateDeleted`, `NamespaceProvisioningStateDeleting`, `NamespaceProvisioningStateFailed`, `NamespaceProvisioningStateSucceeded`, `NamespaceProvisioningStateUpdatedFailed`, `NamespaceProvisioningStateUpdating` +- New enum type `NamespaceTopicProvisioningState` with values `NamespaceTopicProvisioningStateCanceled`, `NamespaceTopicProvisioningStateCreateFailed`, `NamespaceTopicProvisioningStateCreating`, `NamespaceTopicProvisioningStateDeleteFailed`, `NamespaceTopicProvisioningStateDeleted`, `NamespaceTopicProvisioningStateDeleting`, `NamespaceTopicProvisioningStateFailed`, `NamespaceTopicProvisioningStateSucceeded`, `NamespaceTopicProvisioningStateUpdatedFailed`, `NamespaceTopicProvisioningStateUpdating` +- 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 `PermissionBindingProvisioningState` with values `PermissionBindingProvisioningStateCanceled`, `PermissionBindingProvisioningStateCreating`, `PermissionBindingProvisioningStateDeleted`, `PermissionBindingProvisioningStateDeleting`, `PermissionBindingProvisioningStateFailed`, `PermissionBindingProvisioningStateSucceeded`, `PermissionBindingProvisioningStateUpdating` +- New enum type `PermissionType` with values `PermissionTypePublisher`, `PermissionTypeSubscriber` +- New enum type `PublisherType` with values `PublisherTypeCustom` +- New enum type `ResourceKind` with values `ResourceKindAzure`, `ResourceKindAzureArc` +- New enum type `RoutingIdentityType` with values `RoutingIdentityTypeNone`, `RoutingIdentityTypeSystemAssigned`, `RoutingIdentityTypeUserAssigned` +- New enum type `SKU` with values `SKUBasic`, `SKUPremium` +- New enum type `SKUName` with values `SKUNameStandard` +- New enum type `StaticRoutingEnrichmentType` with values `StaticRoutingEnrichmentTypeString` +- New enum type `SubscriptionProvisioningState` with values `SubscriptionProvisioningStateAwaitingManualAction`, `SubscriptionProvisioningStateCanceled`, `SubscriptionProvisioningStateCreateFailed`, `SubscriptionProvisioningStateCreating`, `SubscriptionProvisioningStateDeleteFailed`, `SubscriptionProvisioningStateDeleted`, `SubscriptionProvisioningStateDeleting`, `SubscriptionProvisioningStateFailed`, `SubscriptionProvisioningStateSucceeded`, `SubscriptionProvisioningStateUpdatedFailed`, `SubscriptionProvisioningStateUpdating` +- New enum type `TLSVersion` with values `TLSVersionOne0`, `TLSVersionOne1`, `TLSVersionOne2` +- New enum type `TopicSpaceProvisioningState` with values `TopicSpaceProvisioningStateCanceled`, `TopicSpaceProvisioningStateCreating`, `TopicSpaceProvisioningStateDeleted`, `TopicSpaceProvisioningStateDeleting`, `TopicSpaceProvisioningStateFailed`, `TopicSpaceProvisioningStateSucceeded`, `TopicSpaceProvisioningStateUpdating` +- New enum type `TopicSpacesConfigurationState` with values `TopicSpacesConfigurationStateDisabled`, `TopicSpacesConfigurationStateEnabled` +- New function `*AzureADPartnerClientAuthentication.GetPartnerClientAuthentication() *PartnerClientAuthentication` +- New function `*BoolEqualsFilter.GetFilter() *Filter` +- New function `NewCaCertificatesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CaCertificatesClient, error)` +- New function `*CaCertificatesClient.BeginCreateOrUpdate(context.Context, string, string, string, CaCertificate, *CaCertificatesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CaCertificatesClientCreateOrUpdateResponse], error)` +- New function `*CaCertificatesClient.BeginDelete(context.Context, string, string, string, *CaCertificatesClientBeginDeleteOptions) (*runtime.Poller[CaCertificatesClientDeleteResponse], error)` +- New function `*CaCertificatesClient.Get(context.Context, string, string, string, *CaCertificatesClientGetOptions) (CaCertificatesClientGetResponse, error)` +- New function `*CaCertificatesClient.NewListByNamespacePager(string, string, *CaCertificatesClientListByNamespaceOptions) *runtime.Pager[CaCertificatesClientListByNamespaceResponse]` +- New function `*ClientFactory.NewCaCertificatesClient() *CaCertificatesClient` +- New function `*ClientFactory.NewClientGroupsClient() *ClientGroupsClient` +- New function `*ClientFactory.NewClientsClient() *ClientsClient` +- New function `*ClientFactory.NewNamespaceTopicEventSubscriptionsClient() *NamespaceTopicEventSubscriptionsClient` +- New function `*ClientFactory.NewNamespaceTopicsClient() *NamespaceTopicsClient` +- New function `*ClientFactory.NewNamespacesClient() *NamespacesClient` +- New function `*ClientFactory.NewPartnerDestinationsClient() *PartnerDestinationsClient` +- New function `*ClientFactory.NewPermissionBindingsClient() *PermissionBindingsClient` +- New function `*ClientFactory.NewTopicSpacesClient() *TopicSpacesClient` +- New function `NewClientGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClientGroupsClient, error)` +- New function `*ClientGroupsClient.BeginCreateOrUpdate(context.Context, string, string, string, ClientGroup, *ClientGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientGroupsClientCreateOrUpdateResponse], error)` +- New function `*ClientGroupsClient.BeginDelete(context.Context, string, string, string, *ClientGroupsClientBeginDeleteOptions) (*runtime.Poller[ClientGroupsClientDeleteResponse], error)` +- New function `*ClientGroupsClient.Get(context.Context, string, string, string, *ClientGroupsClientGetOptions) (ClientGroupsClientGetResponse, error)` +- New function `*ClientGroupsClient.NewListByNamespacePager(string, string, *ClientGroupsClientListByNamespaceOptions) *runtime.Pager[ClientGroupsClientListByNamespaceResponse]` +- New function `NewClientsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClientsClient, error)` +- New function `*ClientsClient.BeginCreateOrUpdate(context.Context, string, string, string, Client, *ClientsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientsClientCreateOrUpdateResponse], error)` +- New function `*ClientsClient.BeginDelete(context.Context, string, string, string, *ClientsClientBeginDeleteOptions) (*runtime.Poller[ClientsClientDeleteResponse], error)` +- New function `*ClientsClient.Get(context.Context, string, string, string, *ClientsClientGetOptions) (ClientsClientGetResponse, error)` +- New function `*ClientsClient.NewListByNamespacePager(string, string, *ClientsClientListByNamespaceOptions) *runtime.Pager[ClientsClientListByNamespaceResponse]` +- New function `*Filter.GetFilter() *Filter` +- New function `*IsNotNullFilter.GetFilter() *Filter` +- New function `*IsNullOrUndefinedFilter.GetFilter() *Filter` +- 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 `NewPermissionBindingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PermissionBindingsClient, error)` +- New function `*PermissionBindingsClient.BeginCreateOrUpdate(context.Context, string, string, string, PermissionBinding, *PermissionBindingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PermissionBindingsClientCreateOrUpdateResponse], error)` +- New function `*PermissionBindingsClient.BeginDelete(context.Context, string, string, string, *PermissionBindingsClientBeginDeleteOptions) (*runtime.Poller[PermissionBindingsClientDeleteResponse], error)` +- New function `*PermissionBindingsClient.Get(context.Context, string, string, string, *PermissionBindingsClientGetOptions) (PermissionBindingsClientGetResponse, error)` +- New function `*PermissionBindingsClient.NewListByNamespacePager(string, string, *PermissionBindingsClientListByNamespaceOptions) *runtime.Pager[PermissionBindingsClientListByNamespaceResponse]` +- New function `*StringBeginsWithFilter.GetFilter() *Filter` +- New function `*StringContainsFilter.GetFilter() *Filter` +- New function `*StringEndsWithFilter.GetFilter() *Filter` +- New function `*StringInFilter.GetFilter() *Filter` +- New function `*StringNotBeginsWithFilter.GetFilter() *Filter` +- New function `*StringNotContainsFilter.GetFilter() *Filter` +- New function `*StringNotEndsWithFilter.GetFilter() *Filter` +- New function `*StringNotInFilter.GetFilter() *Filter` +- New function `NewTopicSpacesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TopicSpacesClient, error)` +- New function `*TopicSpacesClient.BeginCreateOrUpdate(context.Context, string, string, string, TopicSpace, *TopicSpacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[TopicSpacesClientCreateOrUpdateResponse], error)` +- New function `*TopicSpacesClient.BeginDelete(context.Context, string, string, string, *TopicSpacesClientBeginDeleteOptions) (*runtime.Poller[TopicSpacesClientDeleteResponse], error)` +- New function `*TopicSpacesClient.Get(context.Context, string, string, string, *TopicSpacesClientGetOptions) (TopicSpacesClientGetResponse, error)` +- New function `*TopicSpacesClient.NewListByNamespacePager(string, string, *TopicSpacesClientListByNamespaceOptions) *runtime.Pager[TopicSpacesClientListByNamespaceResponse]` +- New function `*WebhookPartnerDestinationInfo.GetPartnerDestinationInfo() *PartnerDestinationInfo` +- New function `*WebhookUpdatePartnerDestinationInfo.GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo` +- New function `NewNamespaceTopicEventSubscriptionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NamespaceTopicEventSubscriptionsClient, error)` +- New function `*NamespaceTopicEventSubscriptionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, Subscription, *NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespaceTopicEventSubscriptionsClientCreateOrUpdateResponse], error)` +- New function `*NamespaceTopicEventSubscriptionsClient.BeginDelete(context.Context, string, string, string, string, *NamespaceTopicEventSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[NamespaceTopicEventSubscriptionsClientDeleteResponse], error)` +- New function `*NamespaceTopicEventSubscriptionsClient.Get(context.Context, string, string, string, string, *NamespaceTopicEventSubscriptionsClientGetOptions) (NamespaceTopicEventSubscriptionsClientGetResponse, error)` +- New function `*NamespaceTopicEventSubscriptionsClient.NewListByNamespaceTopicPager(string, string, string, *NamespaceTopicEventSubscriptionsClientListByNamespaceTopicOptions) *runtime.Pager[NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse]` +- New function `*NamespaceTopicEventSubscriptionsClient.BeginUpdate(context.Context, string, string, string, string, SubscriptionUpdateParameters, *NamespaceTopicEventSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[NamespaceTopicEventSubscriptionsClientUpdateResponse], error)` +- New function `NewNamespaceTopicsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NamespaceTopicsClient, error)` +- New function `*NamespaceTopicsClient.BeginCreateOrUpdate(context.Context, string, string, string, NamespaceTopic, *NamespaceTopicsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespaceTopicsClientCreateOrUpdateResponse], error)` +- New function `*NamespaceTopicsClient.BeginDelete(context.Context, string, string, string, *NamespaceTopicsClientBeginDeleteOptions) (*runtime.Poller[NamespaceTopicsClientDeleteResponse], error)` +- New function `*NamespaceTopicsClient.Get(context.Context, string, string, string, *NamespaceTopicsClientGetOptions) (NamespaceTopicsClientGetResponse, error)` +- New function `*NamespaceTopicsClient.NewListByNamespacePager(string, string, *NamespaceTopicsClientListByNamespaceOptions) *runtime.Pager[NamespaceTopicsClientListByNamespaceResponse]` +- New function `*NamespaceTopicsClient.ListSharedAccessKeys(context.Context, string, string, string, *NamespaceTopicsClientListSharedAccessKeysOptions) (NamespaceTopicsClientListSharedAccessKeysResponse, error)` +- New function `*NamespaceTopicsClient.BeginRegenerateKey(context.Context, string, string, string, TopicRegenerateKeyRequest, *NamespaceTopicsClientBeginRegenerateKeyOptions) (*runtime.Poller[NamespaceTopicsClientRegenerateKeyResponse], error)` +- New function `*NamespaceTopicsClient.BeginUpdate(context.Context, string, string, string, NamespaceTopicUpdateParameters, *NamespaceTopicsClientBeginUpdateOptions) (*runtime.Poller[NamespaceTopicsClientUpdateResponse], error)` +- New function `NewNamespacesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NamespacesClient, error)` +- New function `*NamespacesClient.BeginCreateOrUpdate(context.Context, string, string, Namespace, *NamespacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespacesClientCreateOrUpdateResponse], error)` +- New function `*NamespacesClient.BeginDelete(context.Context, string, string, *NamespacesClientBeginDeleteOptions) (*runtime.Poller[NamespacesClientDeleteResponse], error)` +- New function `*NamespacesClient.Get(context.Context, string, string, *NamespacesClientGetOptions) (NamespacesClientGetResponse, error)` +- New function `*NamespacesClient.NewListByResourceGroupPager(string, *NamespacesClientListByResourceGroupOptions) *runtime.Pager[NamespacesClientListByResourceGroupResponse]` +- New function `*NamespacesClient.NewListBySubscriptionPager(*NamespacesClientListBySubscriptionOptions) *runtime.Pager[NamespacesClientListBySubscriptionResponse]` +- New function `*NamespacesClient.ListSharedAccessKeys(context.Context, string, string, *NamespacesClientListSharedAccessKeysOptions) (NamespacesClientListSharedAccessKeysResponse, error)` +- New function `*NamespacesClient.BeginRegenerateKey(context.Context, string, string, NamespaceRegenerateKeyRequest, *NamespacesClientBeginRegenerateKeyOptions) (*runtime.Poller[NamespacesClientRegenerateKeyResponse], error)` +- New function `*NamespacesClient.BeginUpdate(context.Context, string, string, NamespaceUpdateParameters, *NamespacesClientBeginUpdateOptions) (*runtime.Poller[NamespacesClientUpdateResponse], error)` +- New function `*NumberGreaterThanFilter.GetFilter() *Filter` +- New function `*NumberGreaterThanOrEqualsFilter.GetFilter() *Filter` +- New function `*NumberInFilter.GetFilter() *Filter` +- New function `*NumberInRangeFilter.GetFilter() *Filter` +- New function `*NumberLessThanFilter.GetFilter() *Filter` +- New function `*NumberLessThanOrEqualsFilter.GetFilter() *Filter` +- New function `*NumberNotInFilter.GetFilter() *Filter` +- New function `*NumberNotInRangeFilter.GetFilter() *Filter` +- New struct `AzureADPartnerClientAuthentication` +- New struct `AzureADPartnerClientAuthenticationProperties` +- New struct `BoolEqualsFilter` +- New struct `CaCertificate` +- New struct `CaCertificateProperties` +- New struct `CaCertificatesListResult` +- New struct `Client` +- New struct `ClientAuthentication` +- New struct `ClientAuthenticationSettings` +- New struct `ClientCertificateAuthentication` +- New struct `ClientCertificateSubjectDistinguishedName` +- New struct `ClientCertificateThumbprint` +- New struct `ClientGroup` +- New struct `ClientGroupProperties` +- New struct `ClientGroupsListResult` +- New struct `ClientProperties` +- New struct `ClientsListResult` +- New struct `DeliveryConfiguration` +- New struct `DynamicRoutingEnrichment` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- New struct `ExtendedLocation` +- New struct `FiltersConfiguration` +- New struct `IsNotNullFilter` +- New struct `IsNullOrUndefinedFilter` +- New struct `Namespace` +- New struct `NamespaceProperties` +- New struct `NamespaceRegenerateKeyRequest` +- New struct `NamespaceSKU` +- New struct `NamespaceSharedAccessKeys` +- New struct `NamespaceTopic` +- New struct `NamespaceTopicProperties` +- New struct `NamespaceTopicUpdateParameterProperties` +- New struct `NamespaceTopicUpdateParameters` +- New struct `NamespaceTopicsListResult` +- New struct `NamespaceUpdateParameterProperties` +- New struct `NamespaceUpdateParameters` +- New struct `NamespacesListResult` +- New struct `NumberGreaterThanFilter` +- New struct `NumberGreaterThanOrEqualsFilter` +- New struct `NumberInFilter` +- New struct `NumberInRangeFilter` +- New struct `NumberLessThanFilter` +- New struct `NumberLessThanOrEqualsFilter` +- New struct `NumberNotInFilter` +- New struct `NumberNotInRangeFilter` +- New struct `PartnerDestination` +- New struct `PartnerDestinationProperties` +- New struct `PartnerDestinationUpdateParameters` +- New struct `PartnerDestinationsListResult` +- New struct `PartnerEventSubscriptionDestination` +- New struct `PartnerEventSubscriptionDestinationProperties` +- New struct `PermissionBinding` +- New struct `PermissionBindingProperties` +- New struct `PermissionBindingsListResult` +- New struct `QueueInfo` +- New struct `ResourceMoveChangeHistory` +- New struct `ResourceSKU` +- New struct `RoutingEnrichments` +- New struct `RoutingIdentityInfo` +- New struct `StaticRoutingEnrichment` +- New struct `StringBeginsWithFilter` +- New struct `StringContainsFilter` +- New struct `StringEndsWithFilter` +- New struct `StringInFilter` +- New struct `StringNotBeginsWithFilter` +- New struct `StringNotContainsFilter` +- New struct `StringNotEndsWithFilter` +- New struct `StringNotInFilter` +- New struct `Subscription` +- New struct `SubscriptionProperties` +- New struct `SubscriptionUpdateParameters` +- New struct `SubscriptionUpdateParametersProperties` +- New struct `SubscriptionsListResult` +- New struct `TopicSpace` +- New struct `TopicSpaceProperties` +- New struct `TopicSpacesConfiguration` +- New struct `TopicSpacesListResult` +- New struct `TopicsConfiguration` +- New struct `UpdateTopicSpacesConfigurationInfo` +- 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 `EventTypeInfo`, `MinimumTLSVersionAllowed` in struct `DomainProperties` +- New field `EventTypeInfo`, `MinimumTLSVersionAllowed` in struct `DomainUpdateParameterProperties` +- New field `SKU` in struct `DomainUpdateParameters` +- New field `MinimumTLSVersionAllowed` in struct `PartnerNamespaceProperties` +- New field `MinimumTLSVersionAllowed` in struct `PartnerNamespaceUpdateParameterProperties` +- New field `ExtendedLocation`, `Kind`, `SKU` in struct `Topic` +- New field `EventTypeInfo`, `MinimumTLSVersionAllowed` in struct `TopicProperties` +- New field `AreRegionalAndGlobalSourcesSupported` in struct `TopicTypeProperties` +- New field `EventTypeInfo`, `MinimumTLSVersionAllowed` in struct `TopicUpdateParameterProperties` +- New field `SKU` in struct `TopicUpdateParameters` +- New field `PartnerDestinationDetails` in struct `VerifiedPartnerProperties` +- New field `MinimumTLSVersionAllowed` in struct `WebHookEventSubscriptionDestinationProperties` + + ## 2.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md b/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md index 6a9e7bbff446..cfb2fae18a17 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md +++ b/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f88928d723133dc392e3297e6d61b7f6d10501fd/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.1.1 +module-version: 2.2.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 new file mode 100644 index 000000000000..308b9fe2f0de --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/cacertificates_client.go @@ -0,0 +1,330 @@ +//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 + +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" +) + +// CaCertificatesClient contains the methods for the CaCertificates group. +// Don't use this type directly, use NewCaCertificatesClient() instead. +type CaCertificatesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCaCertificatesClient creates a new instance of CaCertificatesClient 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 NewCaCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CaCertificatesClient, error) { + cl, err := arm.NewClient(moduleName+".CaCertificatesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CaCertificatesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - caCertificateName - The CA certificate name. +// - caCertificateInfo - CA certificate information. +// - options - CaCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CaCertificatesClient.BeginCreateOrUpdate +// method. +func (client *CaCertificatesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, caCertificateInfo CaCertificate, options *CaCertificatesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CaCertificatesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, caCertificateName, caCertificateInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CaCertificatesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[CaCertificatesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 2023-06-01-preview +func (client *CaCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, caCertificateInfo CaCertificate, options *CaCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, caCertificateName, caCertificateInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CaCertificatesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, caCertificateInfo CaCertificate, options *CaCertificatesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/caCertificates/{caCertificateName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if caCertificateName == "" { + return nil, errors.New("parameter caCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{caCertificateName}", url.PathEscape(caCertificateName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, caCertificateInfo) +} + +// BeginDelete - Delete an existing CA certificate. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - CaCertificatesClientBeginDeleteOptions contains the optional parameters for the CaCertificatesClient.BeginDelete +// method. +func (client *CaCertificatesClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, options *CaCertificatesClientBeginDeleteOptions) (*runtime.Poller[CaCertificatesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, caCertificateName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CaCertificatesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[CaCertificatesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete an existing CA certificate. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *CaCertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, options *CaCertificatesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, caCertificateName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CaCertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, options *CaCertificatesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/caCertificates/{caCertificateName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if caCertificateName == "" { + return nil, errors.New("parameter caCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{caCertificateName}", url.PathEscape(caCertificateName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a CA certificate. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - CaCertificatesClientGetOptions contains the optional parameters for the CaCertificatesClient.Get method. +func (client *CaCertificatesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, options *CaCertificatesClientGetOptions) (CaCertificatesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, caCertificateName, options) + if err != nil { + return CaCertificatesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CaCertificatesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CaCertificatesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CaCertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, caCertificateName string, options *CaCertificatesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/caCertificates/{caCertificateName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if caCertificateName == "" { + return nil, errors.New("parameter caCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{caCertificateName}", url.PathEscape(caCertificateName)) + 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", "2023-06-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 *CaCertificatesClient) getHandleResponse(resp *http.Response) (CaCertificatesClientGetResponse, error) { + result := CaCertificatesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CaCertificate); err != nil { + return CaCertificatesClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespacePager - Get all the CA certificates under a namespace. +// +// Generated from API version 2023-06-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 +// method. +func (client *CaCertificatesClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *CaCertificatesClientListByNamespaceOptions) *runtime.Pager[CaCertificatesClientListByNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[CaCertificatesClientListByNamespaceResponse]{ + More: func(page CaCertificatesClientListByNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CaCertificatesClientListByNamespaceResponse) (CaCertificatesClientListByNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CaCertificatesClientListByNamespaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CaCertificatesClientListByNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CaCertificatesClientListByNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceHandleResponse(resp) + }, + }) +} + +// listByNamespaceCreateRequest creates the ListByNamespace request. +func (client *CaCertificatesClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *CaCertificatesClientListByNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/caCertificates" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceHandleResponse handles the ListByNamespace response. +func (client *CaCertificatesClient) listByNamespaceHandleResponse(resp *http.Response) (CaCertificatesClientListByNamespaceResponse, error) { + result := CaCertificatesClientListByNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CaCertificatesListResult); err != nil { + return CaCertificatesClientListByNamespaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go index d590690fda17..12f65eada4f7 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/channels_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -94,7 +94,7 @@ func (client *ChannelsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, channelInfo) @@ -112,7 +112,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -132,7 +132,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *ChannelsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerNamespaceName, channelName, options) if err != nil { @@ -172,7 +172,7 @@ func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -180,7 +180,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -224,7 +224,7 @@ func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +242,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the Channel. @@ -286,7 +286,7 @@ func (client *ChannelsClient) getFullURLCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +303,7 @@ func (client *ChannelsClient) getFullURLHandleResponse(resp *http.Response) (Cha // NewListByPartnerNamespacePager - List all the channels in a partner namespace. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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 @@ -356,7 +356,7 @@ func (client *ChannelsClient) listByPartnerNamespaceCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -380,7 +380,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the partners subscription. // - partnerNamespaceName - Name of the partner namespace. // - channelName - Name of the channel. @@ -425,7 +425,7 @@ func (client *ChannelsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, channelUpdateParameters) } 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 25a657c3451d..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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.410433Z"); 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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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.410433Z"); 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.410433Z"); 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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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.410433Z"); 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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 1910e0abd751..17ee72896c8e 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/client_factory.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/client_factory.go @@ -39,11 +39,26 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } +func (c *ClientFactory) NewCaCertificatesClient() *CaCertificatesClient { + subClient, _ := NewCaCertificatesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewChannelsClient() *ChannelsClient { subClient, _ := NewChannelsClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewClientGroupsClient() *ClientGroupsClient { + subClient, _ := NewClientGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewClientsClient() *ClientsClient { + subClient, _ := NewClientsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewDomainsClient() *DomainsClient { subClient, _ := NewDomainsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -54,6 +69,11 @@ func (c *ClientFactory) NewDomainTopicsClient() *DomainTopicsClient { return subClient } +func (c *ClientFactory) NewDomainTopicEventSubscriptionsClient() *DomainTopicEventSubscriptionsClient { + subClient, _ := NewDomainTopicEventSubscriptionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewTopicEventSubscriptionsClient() *TopicEventSubscriptionsClient { subClient, _ := NewTopicEventSubscriptionsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -69,13 +89,13 @@ func (c *ClientFactory) NewEventSubscriptionsClient() *EventSubscriptionsClient return subClient } -func (c *ClientFactory) NewDomainTopicEventSubscriptionsClient() *DomainTopicEventSubscriptionsClient { - subClient, _ := NewDomainTopicEventSubscriptionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSystemTopicEventSubscriptionsClient() *SystemTopicEventSubscriptionsClient { + subClient, _ := NewSystemTopicEventSubscriptionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSystemTopicEventSubscriptionsClient() *SystemTopicEventSubscriptionsClient { - subClient, _ := NewSystemTopicEventSubscriptionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNamespaceTopicEventSubscriptionsClient() *NamespaceTopicEventSubscriptionsClient { + subClient, _ := NewNamespaceTopicEventSubscriptionsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -84,13 +104,18 @@ func (c *ClientFactory) NewPartnerTopicEventSubscriptionsClient() *PartnerTopicE return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewNamespacesClient() *NamespacesClient { + subClient, _ := NewNamespacesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTopicsClient() *TopicsClient { - subClient, _ := NewTopicsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNamespaceTopicsClient() *NamespaceTopicsClient { + subClient, _ := NewNamespaceTopicsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } @@ -99,6 +124,11 @@ func (c *ClientFactory) NewPartnerConfigurationsClient() *PartnerConfigurationsC return subClient } +func (c *ClientFactory) NewPartnerDestinationsClient() *PartnerDestinationsClient { + subClient, _ := NewPartnerDestinationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewPartnerNamespacesClient() *PartnerNamespacesClient { subClient, _ := NewPartnerNamespacesClient(c.subscriptionID, c.credential, c.options) return subClient @@ -114,6 +144,11 @@ func (c *ClientFactory) NewPartnerTopicsClient() *PartnerTopicsClient { return subClient } +func (c *ClientFactory) NewPermissionBindingsClient() *PermissionBindingsClient { + subClient, _ := NewPermissionBindingsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -129,11 +164,21 @@ func (c *ClientFactory) NewSystemTopicsClient() *SystemTopicsClient { return subClient } +func (c *ClientFactory) NewTopicsClient() *TopicsClient { + subClient, _ := NewTopicsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewExtensionTopicsClient() *ExtensionTopicsClient { subClient, _ := NewExtensionTopicsClient(c.credential, c.options) return subClient } +func (c *ClientFactory) NewTopicSpacesClient() *TopicSpacesClient { + subClient, _ := NewTopicSpacesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewTopicTypesClient() *TopicTypesClient { subClient, _ := NewTopicTypesClient(c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client.go new file mode 100644 index 000000000000..011a9829a191 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/clientgroups_client.go @@ -0,0 +1,330 @@ +//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 + +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" +) + +// ClientGroupsClient contains the methods for the ClientGroups group. +// Don't use this type directly, use NewClientGroupsClient() instead. +type ClientGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewClientGroupsClient creates a new instance of ClientGroupsClient 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 NewClientGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".ClientGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ClientGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - clientGroupName - The client group name. +// - clientGroupInfo - Client group information. +// - options - ClientGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClientGroupsClient.BeginCreateOrUpdate +// method. +func (client *ClientGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, clientGroupInfo ClientGroup, options *ClientGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, clientGroupName, clientGroupInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ClientGroupsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 2023-06-01-preview +func (client *ClientGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, clientGroupInfo ClientGroup, options *ClientGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, clientGroupName, clientGroupInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ClientGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, clientGroupInfo ClientGroup, options *ClientGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clientGroups/{clientGroupName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if clientGroupName == "" { + return nil, errors.New("parameter clientGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientGroupName}", url.PathEscape(clientGroupName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, clientGroupInfo) +} + +// BeginDelete - Delete an existing client group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - ClientGroupsClientBeginDeleteOptions contains the optional parameters for the ClientGroupsClient.BeginDelete +// method. +func (client *ClientGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, options *ClientGroupsClientBeginDeleteOptions) (*runtime.Poller[ClientGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, clientGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ClientGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete an existing client group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *ClientGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, options *ClientGroupsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, clientGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ClientGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, options *ClientGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clientGroups/{clientGroupName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if clientGroupName == "" { + return nil, errors.New("parameter clientGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientGroupName}", url.PathEscape(clientGroupName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a client group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - ClientGroupsClientGetOptions contains the optional parameters for the ClientGroupsClient.Get method. +func (client *ClientGroupsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, options *ClientGroupsClientGetOptions) (ClientGroupsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, clientGroupName, options) + if err != nil { + return ClientGroupsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ClientGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientGroupsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ClientGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, clientGroupName string, options *ClientGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clientGroups/{clientGroupName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if clientGroupName == "" { + return nil, errors.New("parameter clientGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientGroupName}", url.PathEscape(clientGroupName)) + 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", "2023-06-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 *ClientGroupsClient) getHandleResponse(resp *http.Response) (ClientGroupsClientGetResponse, error) { + result := ClientGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ClientGroup); err != nil { + return ClientGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespacePager - Get all the client groups under a namespace. +// +// Generated from API version 2023-06-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 +// method. +func (client *ClientGroupsClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *ClientGroupsClientListByNamespaceOptions) *runtime.Pager[ClientGroupsClientListByNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[ClientGroupsClientListByNamespaceResponse]{ + More: func(page ClientGroupsClientListByNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ClientGroupsClientListByNamespaceResponse) (ClientGroupsClientListByNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ClientGroupsClientListByNamespaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ClientGroupsClientListByNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientGroupsClientListByNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceHandleResponse(resp) + }, + }) +} + +// listByNamespaceCreateRequest creates the ListByNamespace request. +func (client *ClientGroupsClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *ClientGroupsClientListByNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clientGroups" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceHandleResponse handles the ListByNamespace response. +func (client *ClientGroupsClient) listByNamespaceHandleResponse(resp *http.Response) (ClientGroupsClientListByNamespaceResponse, error) { + result := ClientGroupsClientListByNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ClientGroupsListResult); err != nil { + return ClientGroupsClientListByNamespaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/clients_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/clients_client.go new file mode 100644 index 000000000000..e34024e38aca --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/clients_client.go @@ -0,0 +1,329 @@ +//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 + +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" +) + +// ClientsClient contains the methods for the Clients group. +// Don't use this type directly, use NewClientsClient() instead. +type ClientsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewClientsClient creates a new instance of ClientsClient 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 NewClientsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientsClient, error) { + cl, err := arm.NewClient(moduleName+".ClientsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ClientsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update a client with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - clientName - The client name. +// - clientInfo - Client information. +// - options - ClientsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClientsClient.BeginCreateOrUpdate +// method. +func (client *ClientsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, clientInfo Client, options *ClientsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, clientName, clientInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ClientsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update a client with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *ClientsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, clientInfo Client, options *ClientsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, clientName, clientInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ClientsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, clientInfo Client, options *ClientsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clients/{clientName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if clientName == "" { + return nil, errors.New("parameter clientName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientName}", url.PathEscape(clientName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, clientInfo) +} + +// BeginDelete - Delete an existing client. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - clientName - Name of the client. +// - options - ClientsClientBeginDeleteOptions contains the optional parameters for the ClientsClient.BeginDelete method. +func (client *ClientsClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, options *ClientsClientBeginDeleteOptions) (*runtime.Poller[ClientsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, clientName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ClientsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete an existing client. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *ClientsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, options *ClientsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, clientName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ClientsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, options *ClientsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clients/{clientName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if clientName == "" { + return nil, errors.New("parameter clientName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientName}", url.PathEscape(clientName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a client. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - clientName - Name of the client. +// - options - ClientsClientGetOptions contains the optional parameters for the ClientsClient.Get method. +func (client *ClientsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, options *ClientsClientGetOptions) (ClientsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, clientName, options) + if err != nil { + return ClientsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ClientsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ClientsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, clientName string, options *ClientsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clients/{clientName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if clientName == "" { + return nil, errors.New("parameter clientName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientName}", url.PathEscape(clientName)) + 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", "2023-06-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 *ClientsClient) getHandleResponse(resp *http.Response) (ClientsClientGetResponse, error) { + result := ClientsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Client); err != nil { + return ClientsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespacePager - Get all the permission bindings under a namespace. +// +// Generated from API version 2023-06-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 +// method. +func (client *ClientsClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *ClientsClientListByNamespaceOptions) *runtime.Pager[ClientsClientListByNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[ClientsClientListByNamespaceResponse]{ + More: func(page ClientsClientListByNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ClientsClientListByNamespaceResponse) (ClientsClientListByNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ClientsClientListByNamespaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ClientsClientListByNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClientsClientListByNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceHandleResponse(resp) + }, + }) +} + +// listByNamespaceCreateRequest creates the ListByNamespace request. +func (client *ClientsClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *ClientsClientListByNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/clients" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceHandleResponse handles the ListByNamespace response. +func (client *ClientsClient) listByNamespaceHandleResponse(resp *http.Response) (ClientsClientListByNamespaceResponse, error) { + result := ClientsClientListByNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ClientsListResult); err != nil { + return ClientsClientListByNamespaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/constants.go b/sdk/resourcemanager/eventgrid/armeventgrid/constants.go index 82dcc2adc95e..9e28731ea181 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/constants.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/constants.go @@ -11,7 +11,7 @@ package armeventgrid const ( moduleName = "armeventgrid" - moduleVersion = "v2.1.1" + moduleVersion = "v2.2.0-beta.1" ) // AdvancedFilterOperatorType - The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -64,17 +64,65 @@ func PossibleAdvancedFilterOperatorTypeValues() []AdvancedFilterOperatorType { } } +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 + +const ( + CaCertificateProvisioningStateCanceled CaCertificateProvisioningState = "Canceled" + CaCertificateProvisioningStateCreating CaCertificateProvisioningState = "Creating" + CaCertificateProvisioningStateDeleted CaCertificateProvisioningState = "Deleted" + CaCertificateProvisioningStateDeleting CaCertificateProvisioningState = "Deleting" + CaCertificateProvisioningStateFailed CaCertificateProvisioningState = "Failed" + CaCertificateProvisioningStateSucceeded CaCertificateProvisioningState = "Succeeded" + CaCertificateProvisioningStateUpdating CaCertificateProvisioningState = "Updating" +) + +// PossibleCaCertificateProvisioningStateValues returns the possible values for the CaCertificateProvisioningState const type. +func PossibleCaCertificateProvisioningStateValues() []CaCertificateProvisioningState { + return []CaCertificateProvisioningState{ + CaCertificateProvisioningStateCanceled, + CaCertificateProvisioningStateCreating, + CaCertificateProvisioningStateDeleted, + CaCertificateProvisioningStateDeleting, + CaCertificateProvisioningStateFailed, + CaCertificateProvisioningStateSucceeded, + CaCertificateProvisioningStateUpdating, + } +} + // ChannelProvisioningState - Provisioning state of the channel. 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. @@ -84,6 +132,7 @@ func PossibleChannelProvisioningStateValues() []ChannelProvisioningState { ChannelProvisioningStateCreating, ChannelProvisioningStateDeleting, ChannelProvisioningStateFailed, + ChannelProvisioningStateIdleDueToMirroredPartnerDestinationDeletion, ChannelProvisioningStateIdleDueToMirroredPartnerTopicDeletion, ChannelProvisioningStateSucceeded, ChannelProvisioningStateUpdating, @@ -94,16 +143,110 @@ 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, } } +// ClientCertificateValidationScheme - The validation scheme used to authenticate the client. Default value is SubjectMatchesAuthenticationName. +type ClientCertificateValidationScheme string + +const ( + ClientCertificateValidationSchemeDNSMatchesAuthenticationName ClientCertificateValidationScheme = "DnsMatchesAuthenticationName" + ClientCertificateValidationSchemeEmailMatchesAuthenticationName ClientCertificateValidationScheme = "EmailMatchesAuthenticationName" + ClientCertificateValidationSchemeIPMatchesAuthenticationName ClientCertificateValidationScheme = "IpMatchesAuthenticationName" + ClientCertificateValidationSchemeSubjectMatchesAuthenticationName ClientCertificateValidationScheme = "SubjectMatchesAuthenticationName" + ClientCertificateValidationSchemeThumbprintMatch ClientCertificateValidationScheme = "ThumbprintMatch" + ClientCertificateValidationSchemeURIMatchesAuthenticationName ClientCertificateValidationScheme = "UriMatchesAuthenticationName" +) + +// PossibleClientCertificateValidationSchemeValues returns the possible values for the ClientCertificateValidationScheme const type. +func PossibleClientCertificateValidationSchemeValues() []ClientCertificateValidationScheme { + return []ClientCertificateValidationScheme{ + ClientCertificateValidationSchemeDNSMatchesAuthenticationName, + ClientCertificateValidationSchemeEmailMatchesAuthenticationName, + ClientCertificateValidationSchemeIPMatchesAuthenticationName, + ClientCertificateValidationSchemeSubjectMatchesAuthenticationName, + ClientCertificateValidationSchemeThumbprintMatch, + ClientCertificateValidationSchemeURIMatchesAuthenticationName, + } +} + +// ClientGroupProvisioningState - Provisioning state of the ClientGroup resource. +type ClientGroupProvisioningState string + +const ( + ClientGroupProvisioningStateCanceled ClientGroupProvisioningState = "Canceled" + ClientGroupProvisioningStateCreating ClientGroupProvisioningState = "Creating" + ClientGroupProvisioningStateDeleted ClientGroupProvisioningState = "Deleted" + ClientGroupProvisioningStateDeleting ClientGroupProvisioningState = "Deleting" + ClientGroupProvisioningStateFailed ClientGroupProvisioningState = "Failed" + ClientGroupProvisioningStateSucceeded ClientGroupProvisioningState = "Succeeded" + ClientGroupProvisioningStateUpdating ClientGroupProvisioningState = "Updating" +) + +// PossibleClientGroupProvisioningStateValues returns the possible values for the ClientGroupProvisioningState const type. +func PossibleClientGroupProvisioningStateValues() []ClientGroupProvisioningState { + return []ClientGroupProvisioningState{ + ClientGroupProvisioningStateCanceled, + ClientGroupProvisioningStateCreating, + ClientGroupProvisioningStateDeleted, + ClientGroupProvisioningStateDeleting, + ClientGroupProvisioningStateFailed, + ClientGroupProvisioningStateSucceeded, + ClientGroupProvisioningStateUpdating, + } +} + +// ClientProvisioningState - Provisioning state of the Client resource. +type ClientProvisioningState string + +const ( + ClientProvisioningStateCanceled ClientProvisioningState = "Canceled" + ClientProvisioningStateCreating ClientProvisioningState = "Creating" + ClientProvisioningStateDeleted ClientProvisioningState = "Deleted" + ClientProvisioningStateDeleting ClientProvisioningState = "Deleting" + ClientProvisioningStateFailed ClientProvisioningState = "Failed" + ClientProvisioningStateSucceeded ClientProvisioningState = "Succeeded" + ClientProvisioningStateUpdating ClientProvisioningState = "Updating" +) + +// PossibleClientProvisioningStateValues returns the possible values for the ClientProvisioningState const type. +func PossibleClientProvisioningStateValues() []ClientProvisioningState { + return []ClientProvisioningState{ + ClientProvisioningStateCanceled, + ClientProvisioningStateCreating, + ClientProvisioningStateDeleted, + ClientProvisioningStateDeleting, + ClientProvisioningStateFailed, + ClientProvisioningStateSucceeded, + ClientProvisioningStateUpdating, + } +} + +// ClientState - Indicates if the client is enabled or not. Default value is Enabled. +type ClientState string + +const ( + ClientStateDisabled ClientState = "Disabled" + ClientStateEnabled ClientState = "Enabled" +) + +// PossibleClientStateValues returns the possible values for the ClientState const type. +func PossibleClientStateValues() []ClientState { + return []ClientState{ + ClientStateDisabled, + ClientStateEnabled, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -170,6 +313,34 @@ func PossibleDeliveryAttributeMappingTypeValues() []DeliveryAttributeMappingType } } +// DeliveryMode - Delivery mode of the event subscription. +type DeliveryMode string + +const ( + DeliveryModeQueue DeliveryMode = "Queue" +) + +// PossibleDeliveryModeValues returns the possible values for the DeliveryMode const type. +func PossibleDeliveryModeValues() []DeliveryMode { + return []DeliveryMode{ + DeliveryModeQueue, + } +} + +// DeliverySchema - The event delivery schema for the event subscription. +type DeliverySchema string + +const ( + DeliverySchemaCloudEventSchemaV10 DeliverySchema = "CloudEventSchemaV1_0" +) + +// PossibleDeliverySchemaValues returns the possible values for the DeliverySchema const type. +func PossibleDeliverySchemaValues() []DeliverySchema { + return []DeliverySchema{ + DeliverySchemaCloudEventSchemaV10, + } +} + // DomainProvisioningState - Provisioning state of the Event Grid Domain Resource. type DomainProvisioningState string @@ -222,13 +393,14 @@ func PossibleDomainTopicProvisioningStateValues() []DomainTopicProvisioningState type EndpointType string const ( - EndpointTypeAzureFunction EndpointType = "AzureFunction" - EndpointTypeEventHub EndpointType = "EventHub" - EndpointTypeHybridConnection EndpointType = "HybridConnection" - EndpointTypeServiceBusQueue EndpointType = "ServiceBusQueue" - EndpointTypeServiceBusTopic EndpointType = "ServiceBusTopic" - EndpointTypeStorageQueue EndpointType = "StorageQueue" - EndpointTypeWebHook EndpointType = "WebHook" + EndpointTypeAzureFunction EndpointType = "AzureFunction" + EndpointTypeEventHub EndpointType = "EventHub" + EndpointTypeHybridConnection EndpointType = "HybridConnection" + 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. @@ -237,6 +409,7 @@ func PossibleEndpointTypeValues() []EndpointType { EndpointTypeAzureFunction, EndpointTypeEventHub, EndpointTypeHybridConnection, + EndpointTypePartnerDestination, EndpointTypeServiceBusQueue, EndpointTypeServiceBusTopic, EndpointTypeStorageQueue, @@ -276,6 +449,20 @@ func PossibleEventDeliverySchemaValues() []EventDeliverySchema { } } +// EventInputSchema - This determines the format that is expected for incoming events published to the topic. +type EventInputSchema string + +const ( + EventInputSchemaCloudEventSchemaV10 EventInputSchema = "CloudEventSchemaV1_0" +) + +// PossibleEventInputSchemaValues returns the possible values for the EventInputSchema const type. +func PossibleEventInputSchemaValues() []EventInputSchema { + return []EventInputSchema{ + EventInputSchemaCloudEventSchemaV10, + } +} + // EventSubscriptionIdentityType - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both // an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity. type EventSubscriptionIdentityType string @@ -319,6 +506,56 @@ func PossibleEventSubscriptionProvisioningStateValues() []EventSubscriptionProvi } } +// FilterOperatorType - The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. +type FilterOperatorType string + +const ( + FilterOperatorTypeBoolEquals FilterOperatorType = "BoolEquals" + FilterOperatorTypeIsNotNull FilterOperatorType = "IsNotNull" + FilterOperatorTypeIsNullOrUndefined FilterOperatorType = "IsNullOrUndefined" + FilterOperatorTypeNumberGreaterThan FilterOperatorType = "NumberGreaterThan" + FilterOperatorTypeNumberGreaterThanOrEquals FilterOperatorType = "NumberGreaterThanOrEquals" + FilterOperatorTypeNumberIn FilterOperatorType = "NumberIn" + FilterOperatorTypeNumberInRange FilterOperatorType = "NumberInRange" + FilterOperatorTypeNumberLessThan FilterOperatorType = "NumberLessThan" + FilterOperatorTypeNumberLessThanOrEquals FilterOperatorType = "NumberLessThanOrEquals" + FilterOperatorTypeNumberNotIn FilterOperatorType = "NumberNotIn" + FilterOperatorTypeNumberNotInRange FilterOperatorType = "NumberNotInRange" + FilterOperatorTypeStringBeginsWith FilterOperatorType = "StringBeginsWith" + FilterOperatorTypeStringContains FilterOperatorType = "StringContains" + FilterOperatorTypeStringEndsWith FilterOperatorType = "StringEndsWith" + FilterOperatorTypeStringIn FilterOperatorType = "StringIn" + FilterOperatorTypeStringNotBeginsWith FilterOperatorType = "StringNotBeginsWith" + FilterOperatorTypeStringNotContains FilterOperatorType = "StringNotContains" + FilterOperatorTypeStringNotEndsWith FilterOperatorType = "StringNotEndsWith" + FilterOperatorTypeStringNotIn FilterOperatorType = "StringNotIn" +) + +// PossibleFilterOperatorTypeValues returns the possible values for the FilterOperatorType const type. +func PossibleFilterOperatorTypeValues() []FilterOperatorType { + return []FilterOperatorType{ + FilterOperatorTypeBoolEquals, + FilterOperatorTypeIsNotNull, + FilterOperatorTypeIsNullOrUndefined, + FilterOperatorTypeNumberGreaterThan, + FilterOperatorTypeNumberGreaterThanOrEquals, + FilterOperatorTypeNumberIn, + FilterOperatorTypeNumberInRange, + FilterOperatorTypeNumberLessThan, + FilterOperatorTypeNumberLessThanOrEquals, + FilterOperatorTypeNumberNotIn, + FilterOperatorTypeNumberNotInRange, + FilterOperatorTypeStringBeginsWith, + FilterOperatorTypeStringContains, + FilterOperatorTypeStringEndsWith, + FilterOperatorTypeStringIn, + FilterOperatorTypeStringNotBeginsWith, + FilterOperatorTypeStringNotContains, + FilterOperatorTypeStringNotEndsWith, + FilterOperatorTypeStringNotIn, + } +} + // IPActionType - Action to perform based on the match or no match of the IpMask. type IPActionType string @@ -387,6 +624,84 @@ func PossibleInputSchemaMappingTypeValues() []InputSchemaMappingType { } } +// NamespaceProvisioningState - Provisioning state of the namespace resource. +type NamespaceProvisioningState string + +const ( + NamespaceProvisioningStateCanceled NamespaceProvisioningState = "Canceled" + NamespaceProvisioningStateCreateFailed NamespaceProvisioningState = "CreateFailed" + NamespaceProvisioningStateCreating NamespaceProvisioningState = "Creating" + NamespaceProvisioningStateDeleteFailed NamespaceProvisioningState = "DeleteFailed" + NamespaceProvisioningStateDeleted NamespaceProvisioningState = "Deleted" + NamespaceProvisioningStateDeleting NamespaceProvisioningState = "Deleting" + NamespaceProvisioningStateFailed NamespaceProvisioningState = "Failed" + NamespaceProvisioningStateSucceeded NamespaceProvisioningState = "Succeeded" + NamespaceProvisioningStateUpdatedFailed NamespaceProvisioningState = "UpdatedFailed" + NamespaceProvisioningStateUpdating NamespaceProvisioningState = "Updating" +) + +// PossibleNamespaceProvisioningStateValues returns the possible values for the NamespaceProvisioningState const type. +func PossibleNamespaceProvisioningStateValues() []NamespaceProvisioningState { + return []NamespaceProvisioningState{ + NamespaceProvisioningStateCanceled, + NamespaceProvisioningStateCreateFailed, + NamespaceProvisioningStateCreating, + NamespaceProvisioningStateDeleteFailed, + NamespaceProvisioningStateDeleted, + NamespaceProvisioningStateDeleting, + NamespaceProvisioningStateFailed, + NamespaceProvisioningStateSucceeded, + NamespaceProvisioningStateUpdatedFailed, + NamespaceProvisioningStateUpdating, + } +} + +// NamespaceTopicProvisioningState - Provisioning state of the namespace topic. +type NamespaceTopicProvisioningState string + +const ( + NamespaceTopicProvisioningStateCanceled NamespaceTopicProvisioningState = "Canceled" + NamespaceTopicProvisioningStateCreateFailed NamespaceTopicProvisioningState = "CreateFailed" + NamespaceTopicProvisioningStateCreating NamespaceTopicProvisioningState = "Creating" + NamespaceTopicProvisioningStateDeleteFailed NamespaceTopicProvisioningState = "DeleteFailed" + NamespaceTopicProvisioningStateDeleted NamespaceTopicProvisioningState = "Deleted" + NamespaceTopicProvisioningStateDeleting NamespaceTopicProvisioningState = "Deleting" + NamespaceTopicProvisioningStateFailed NamespaceTopicProvisioningState = "Failed" + NamespaceTopicProvisioningStateSucceeded NamespaceTopicProvisioningState = "Succeeded" + NamespaceTopicProvisioningStateUpdatedFailed NamespaceTopicProvisioningState = "UpdatedFailed" + NamespaceTopicProvisioningStateUpdating NamespaceTopicProvisioningState = "Updating" +) + +// PossibleNamespaceTopicProvisioningStateValues returns the possible values for the NamespaceTopicProvisioningState const type. +func PossibleNamespaceTopicProvisioningStateValues() []NamespaceTopicProvisioningState { + return []NamespaceTopicProvisioningState{ + NamespaceTopicProvisioningStateCanceled, + NamespaceTopicProvisioningStateCreateFailed, + NamespaceTopicProvisioningStateCreating, + NamespaceTopicProvisioningStateDeleteFailed, + NamespaceTopicProvisioningStateDeleted, + NamespaceTopicProvisioningStateDeleting, + NamespaceTopicProvisioningStateFailed, + NamespaceTopicProvisioningStateSucceeded, + NamespaceTopicProvisioningStateUpdatedFailed, + NamespaceTopicProvisioningStateUpdating, + } +} + +// 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 @@ -411,6 +726,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 @@ -521,6 +892,48 @@ func PossiblePartnerTopicRoutingModeValues() []PartnerTopicRoutingMode { } } +// PermissionBindingProvisioningState - Provisioning state of the PermissionBinding resource. +type PermissionBindingProvisioningState string + +const ( + PermissionBindingProvisioningStateCanceled PermissionBindingProvisioningState = "Canceled" + PermissionBindingProvisioningStateCreating PermissionBindingProvisioningState = "Creating" + PermissionBindingProvisioningStateDeleted PermissionBindingProvisioningState = "Deleted" + PermissionBindingProvisioningStateDeleting PermissionBindingProvisioningState = "Deleting" + PermissionBindingProvisioningStateFailed PermissionBindingProvisioningState = "Failed" + PermissionBindingProvisioningStateSucceeded PermissionBindingProvisioningState = "Succeeded" + PermissionBindingProvisioningStateUpdating PermissionBindingProvisioningState = "Updating" +) + +// PossiblePermissionBindingProvisioningStateValues returns the possible values for the PermissionBindingProvisioningState const type. +func PossiblePermissionBindingProvisioningStateValues() []PermissionBindingProvisioningState { + return []PermissionBindingProvisioningState{ + PermissionBindingProvisioningStateCanceled, + PermissionBindingProvisioningStateCreating, + PermissionBindingProvisioningStateDeleted, + PermissionBindingProvisioningStateDeleting, + PermissionBindingProvisioningStateFailed, + PermissionBindingProvisioningStateSucceeded, + PermissionBindingProvisioningStateUpdating, + } +} + +// PermissionType - The allowed permission. +type PermissionType string + +const ( + PermissionTypePublisher PermissionType = "Publisher" + PermissionTypeSubscriber PermissionType = "Subscriber" +) + +// PossiblePermissionTypeValues returns the possible values for the PermissionType const type. +func PossiblePermissionTypeValues() []PermissionType { + return []PermissionType{ + PermissionTypePublisher, + PermissionTypeSubscriber, + } +} + // PersistedConnectionStatus - Status of the connection. type PersistedConnectionStatus string @@ -545,6 +958,7 @@ type PrivateEndpointConnectionsParentType string const ( PrivateEndpointConnectionsParentTypeDomains PrivateEndpointConnectionsParentType = "domains" + PrivateEndpointConnectionsParentTypeNamespaces PrivateEndpointConnectionsParentType = "namespaces" PrivateEndpointConnectionsParentTypePartnerNamespaces PrivateEndpointConnectionsParentType = "partnerNamespaces" PrivateEndpointConnectionsParentTypeTopics PrivateEndpointConnectionsParentType = "topics" ) @@ -553,6 +967,7 @@ const ( func PossiblePrivateEndpointConnectionsParentTypeValues() []PrivateEndpointConnectionsParentType { return []PrivateEndpointConnectionsParentType{ PrivateEndpointConnectionsParentTypeDomains, + PrivateEndpointConnectionsParentTypeNamespaces, PrivateEndpointConnectionsParentTypePartnerNamespaces, PrivateEndpointConnectionsParentTypeTopics, } @@ -575,6 +990,20 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { } } +// PublisherType - Publisher type of the namespace topic. +type PublisherType string + +const ( + PublisherTypeCustom PublisherType = "Custom" +) + +// PossiblePublisherTypeValues returns the possible values for the PublisherType const type. +func PossiblePublisherTypeValues() []PublisherType { + return []PublisherType{ + PublisherTypeCustom, + } +} + // ReadinessState - The readiness state of the corresponding partner topic. type ReadinessState string @@ -591,6 +1020,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 @@ -631,6 +1076,119 @@ func PossibleResourceRegionTypeValues() []ResourceRegionType { } } +type RoutingIdentityType string + +const ( + RoutingIdentityTypeNone RoutingIdentityType = "None" + RoutingIdentityTypeSystemAssigned RoutingIdentityType = "SystemAssigned" + RoutingIdentityTypeUserAssigned RoutingIdentityType = "UserAssigned" +) + +// PossibleRoutingIdentityTypeValues returns the possible values for the RoutingIdentityType const type. +func PossibleRoutingIdentityTypeValues() []RoutingIdentityType { + return []RoutingIdentityType{ + RoutingIdentityTypeNone, + RoutingIdentityTypeSystemAssigned, + RoutingIdentityTypeUserAssigned, + } +} + +// 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 + +const ( + SKUNameStandard SKUName = "Standard" +) + +// PossibleSKUNameValues returns the possible values for the SKUName const type. +func PossibleSKUNameValues() []SKUName { + return []SKUName{ + SKUNameStandard, + } +} + +// StaticRoutingEnrichmentType - Static routing enrichment value type. For e.g. this property value can be 'String'. +type StaticRoutingEnrichmentType string + +const ( + StaticRoutingEnrichmentTypeString StaticRoutingEnrichmentType = "String" +) + +// PossibleStaticRoutingEnrichmentTypeValues returns the possible values for the StaticRoutingEnrichmentType const type. +func PossibleStaticRoutingEnrichmentTypeValues() []StaticRoutingEnrichmentType { + return []StaticRoutingEnrichmentType{ + StaticRoutingEnrichmentTypeString, + } +} + +// SubscriptionProvisioningState - Provisioning state of the event subscription. +type SubscriptionProvisioningState string + +const ( + SubscriptionProvisioningStateAwaitingManualAction SubscriptionProvisioningState = "AwaitingManualAction" + SubscriptionProvisioningStateCanceled SubscriptionProvisioningState = "Canceled" + SubscriptionProvisioningStateCreateFailed SubscriptionProvisioningState = "CreateFailed" + SubscriptionProvisioningStateCreating SubscriptionProvisioningState = "Creating" + SubscriptionProvisioningStateDeleteFailed SubscriptionProvisioningState = "DeleteFailed" + SubscriptionProvisioningStateDeleted SubscriptionProvisioningState = "Deleted" + SubscriptionProvisioningStateDeleting SubscriptionProvisioningState = "Deleting" + SubscriptionProvisioningStateFailed SubscriptionProvisioningState = "Failed" + SubscriptionProvisioningStateSucceeded SubscriptionProvisioningState = "Succeeded" + SubscriptionProvisioningStateUpdatedFailed SubscriptionProvisioningState = "UpdatedFailed" + SubscriptionProvisioningStateUpdating SubscriptionProvisioningState = "Updating" +) + +// PossibleSubscriptionProvisioningStateValues returns the possible values for the SubscriptionProvisioningState const type. +func PossibleSubscriptionProvisioningStateValues() []SubscriptionProvisioningState { + return []SubscriptionProvisioningState{ + SubscriptionProvisioningStateAwaitingManualAction, + SubscriptionProvisioningStateCanceled, + SubscriptionProvisioningStateCreateFailed, + SubscriptionProvisioningStateCreating, + SubscriptionProvisioningStateDeleteFailed, + SubscriptionProvisioningStateDeleted, + SubscriptionProvisioningStateDeleting, + SubscriptionProvisioningStateFailed, + SubscriptionProvisioningStateSucceeded, + SubscriptionProvisioningStateUpdatedFailed, + SubscriptionProvisioningStateUpdating, + } +} + +// TLSVersion - Minimum TLS version of the publisher allowed to publish to this domain +type TLSVersion string + +const ( + TLSVersionOne0 TLSVersion = "1.0" + TLSVersionOne1 TLSVersion = "1.1" + TLSVersionOne2 TLSVersion = "1.2" +) + +// PossibleTLSVersionValues returns the possible values for the TLSVersion const type. +func PossibleTLSVersionValues() []TLSVersion { + return []TLSVersion{ + TLSVersionOne0, + TLSVersionOne1, + TLSVersionOne2, + } +} + // TopicProvisioningState - Provisioning state of the topic. type TopicProvisioningState string @@ -655,6 +1213,48 @@ func PossibleTopicProvisioningStateValues() []TopicProvisioningState { } } +// TopicSpaceProvisioningState - Provisioning state of the TopicSpace resource. +type TopicSpaceProvisioningState string + +const ( + TopicSpaceProvisioningStateCanceled TopicSpaceProvisioningState = "Canceled" + TopicSpaceProvisioningStateCreating TopicSpaceProvisioningState = "Creating" + TopicSpaceProvisioningStateDeleted TopicSpaceProvisioningState = "Deleted" + TopicSpaceProvisioningStateDeleting TopicSpaceProvisioningState = "Deleting" + TopicSpaceProvisioningStateFailed TopicSpaceProvisioningState = "Failed" + TopicSpaceProvisioningStateSucceeded TopicSpaceProvisioningState = "Succeeded" + TopicSpaceProvisioningStateUpdating TopicSpaceProvisioningState = "Updating" +) + +// PossibleTopicSpaceProvisioningStateValues returns the possible values for the TopicSpaceProvisioningState const type. +func PossibleTopicSpaceProvisioningStateValues() []TopicSpaceProvisioningState { + return []TopicSpaceProvisioningState{ + TopicSpaceProvisioningStateCanceled, + TopicSpaceProvisioningStateCreating, + TopicSpaceProvisioningStateDeleted, + TopicSpaceProvisioningStateDeleting, + TopicSpaceProvisioningStateFailed, + TopicSpaceProvisioningStateSucceeded, + TopicSpaceProvisioningStateUpdating, + } +} + +// TopicSpacesConfigurationState - Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled. +type TopicSpacesConfigurationState string + +const ( + TopicSpacesConfigurationStateDisabled TopicSpacesConfigurationState = "Disabled" + TopicSpacesConfigurationStateEnabled TopicSpacesConfigurationState = "Enabled" +) + +// PossibleTopicSpacesConfigurationStateValues returns the possible values for the TopicSpacesConfigurationState const type. +func PossibleTopicSpacesConfigurationStateValues() []TopicSpacesConfigurationState { + return []TopicSpacesConfigurationState{ + TopicSpacesConfigurationStateDisabled, + TopicSpacesConfigurationStateEnabled, + } +} + // TopicTypeProvisioningState - Provisioning state of the topic type type TopicTypeProvisioningState string diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go index 08b2d727573b..0fff01260e9f 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domaineventsubscriptions_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -72,7 +72,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -112,7 +112,7 @@ func (client *DomainEventSubscriptionsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) @@ -121,7 +121,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 2022-06-15 +// Generated from API version 2023-06-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. Event subscription names must be between 3 and 100 @@ -143,7 +143,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, options) if err != nil { @@ -183,7 +183,7 @@ func (client *DomainEventSubscriptionsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -191,9 +191,9 @@ 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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. -// - domainName - Name of the partner topic. +// - domainName - Name of the domain. // - eventSubscriptionName - Name of the event subscription to be found. Event subscription names must be between 3 and 100 // characters in length and use alphanumeric letters only. // - options - DomainEventSubscriptionsClientGetOptions contains the optional parameters for the DomainEventSubscriptionsClient.Get @@ -237,7 +237,7 @@ func (client *DomainEventSubscriptionsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,9 +255,9 @@ 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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. -// - domainName - Name of the domain topic. +// - domainName - Name of the domain. // - eventSubscriptionName - Name of the event subscription. // - options - DomainEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the DomainEventSubscriptionsClient.GetDeliveryAttributes // method. @@ -300,7 +300,7 @@ func (client *DomainEventSubscriptionsClient) getDeliveryAttributesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,7 +318,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -363,7 +363,7 @@ func (client *DomainEventSubscriptionsClient) getFullURLCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *DomainEventSubscriptionsClient) getFullURLHandleResponse(resp *htt // NewListPager - List all event subscriptions that have been created for a specific topic. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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 @@ -433,7 +433,7 @@ func (client *DomainEventSubscriptionsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -457,7 +457,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -479,7 +479,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -519,7 +519,7 @@ func (client *DomainEventSubscriptionsClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) 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 a95630fd5228..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 bcc9571380b5..fd2643299aaa 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domains_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domains_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainInfo - Domain information. @@ -70,7 +70,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domainInfo Domain, options *DomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, domainInfo, options) if err != nil { @@ -106,7 +106,7 @@ func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainInfo) @@ -115,7 +115,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -134,7 +134,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, options) if err != nil { @@ -170,7 +170,7 @@ func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -178,7 +178,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -217,7 +217,7 @@ func (client *DomainsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *DomainsClient) getHandleResponse(resp *http.Response) (DomainsClie // NewListByResourceGroupPager - List all the domains under a resource group. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -282,7 +282,7 @@ func (client *DomainsClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -305,7 +305,7 @@ func (client *DomainsClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListBySubscriptionPager - List all the domains under an Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - DomainsClientListBySubscriptionOptions contains the optional parameters for the DomainsClient.NewListBySubscriptionPager // method. func (client *DomainsClient) NewListBySubscriptionPager(options *DomainsClientListBySubscriptionOptions) *runtime.Pager[DomainsClientListBySubscriptionResponse] { @@ -348,7 +348,7 @@ func (client *DomainsClient) listBySubscriptionCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -372,7 +372,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -412,7 +412,7 @@ func (client *DomainsClient) listSharedAccessKeysCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -430,7 +430,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -470,7 +470,7 @@ func (client *DomainsClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) @@ -488,7 +488,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainUpdateParameters - Domain update information. @@ -508,7 +508,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainsClient) update(ctx context.Context, resourceGroupName string, domainName string, domainUpdateParameters DomainUpdateParameters, options *DomainsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, domainUpdateParameters, options) if err != nil { @@ -544,7 +544,7 @@ func (client *DomainsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainUpdateParameters) 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 8e23c02a8018..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 93a5ca55410f..556e9a6f5cd8 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopiceventsubscriptions_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -73,7 +73,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -117,7 +117,7 @@ func (client *DomainTopicEventSubscriptionsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) @@ -126,7 +126,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -149,7 +149,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, options) if err != nil { @@ -193,7 +193,7 @@ func (client *DomainTopicEventSubscriptionsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -201,7 +201,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -251,7 +251,7 @@ func (client *DomainTopicEventSubscriptionsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -319,7 +319,7 @@ func (client *DomainTopicEventSubscriptionsClient) getDeliveryAttributesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -387,7 +387,7 @@ func (client *DomainTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +404,7 @@ func (client *DomainTopicEventSubscriptionsClient) getFullURLHandleResponse(resp // NewListPager - List all event subscriptions that have been created for a specific domain topic. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -462,7 +462,7 @@ func (client *DomainTopicEventSubscriptionsClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -486,7 +486,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - topicName - Name of the topic. @@ -509,7 +509,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -553,7 +553,7 @@ func (client *DomainTopicEventSubscriptionsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) 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 0c066848d29d..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 65db74211f3f..6f0dd8d66720 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/domaintopics_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -70,7 +70,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domainTopicName string, options *DomainTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, domainTopicName, options) if err != nil { @@ -110,7 +110,7 @@ func (client *DomainTopicsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +119,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -140,7 +140,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *DomainTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, domainTopicName string, options *DomainTopicsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, domainTopicName, options) if err != nil { @@ -180,7 +180,7 @@ func (client *DomainTopicsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -188,7 +188,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - domainName - Name of the domain. // - domainTopicName - Name of the topic. @@ -232,7 +232,7 @@ func (client *DomainTopicsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *DomainTopicsClient) getHandleResponse(resp *http.Response) (Domain // NewListByDomainPager - List all the topics in a domain. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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 @@ -302,7 +302,7 @@ func (client *DomainTopicsClient) listByDomainCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } 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 d2678f7be601..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 e76874ac481f..5ddd63bda359 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/eventsubscriptions_client.go @@ -50,7 +50,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 2022-06-15 +// Generated from API version 2023-06-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}' @@ -80,7 +80,7 @@ func (client *EventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, // specified scope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *EventSubscriptionsClient) createOrUpdate(ctx context.Context, scope string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *EventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, scope, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -109,7 +109,7 @@ func (client *EventSubscriptionsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) @@ -118,7 +118,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 2022-06-15 +// Generated from API version 2023-06-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}' @@ -145,7 +145,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *EventSubscriptionsClient) deleteOperation(ctx context.Context, scope string, eventSubscriptionName string, options *EventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, scope, eventSubscriptionName, options) if err != nil { @@ -174,7 +174,7 @@ func (client *EventSubscriptionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -182,7 +182,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 2022-06-15 +// Generated from API version 2023-06-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}' @@ -221,7 +221,7 @@ func (client *EventSubscriptionsClient) getCreateRequest(ctx context.Context, sc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +239,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 2022-06-15 +// Generated from API version 2023-06-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}' @@ -279,7 +279,7 @@ func (client *EventSubscriptionsClient) getDeliveryAttributesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,7 +297,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 2022-06-15 +// Generated from API version 2023-06-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}' @@ -337,7 +337,7 @@ func (client *EventSubscriptionsClient) getFullURLCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -412,7 +412,7 @@ func (client *EventSubscriptionsClient) listByDomainTopicCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -435,7 +435,7 @@ func (client *EventSubscriptionsClient) listByDomainTopicHandleResponse(resp *ht // NewListByResourcePager - List all event subscriptions that have been created for a specific resource. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -498,7 +498,7 @@ func (client *EventSubscriptionsClient) listByResourceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -522,7 +522,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -570,7 +570,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -594,7 +594,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupHandleResponse( // NewListGlobalByResourceGroupForTopicTypePager - List all global event subscriptions under a resource group for a specific // topic type. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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 @@ -647,7 +647,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupForTopicTypeCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -670,7 +670,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupForTopicTypeHan // NewListGlobalBySubscriptionPager - List all aggregated global event subscriptions under a specific Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - EventSubscriptionsClientListGlobalBySubscriptionOptions contains the optional parameters for the EventSubscriptionsClient.NewListGlobalBySubscriptionPager // method. func (client *EventSubscriptionsClient) NewListGlobalBySubscriptionPager(options *EventSubscriptionsClientListGlobalBySubscriptionOptions) *runtime.Pager[EventSubscriptionsClientListGlobalBySubscriptionResponse] { @@ -713,7 +713,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -737,7 +737,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionHandleResponse(r // NewListGlobalBySubscriptionForTopicTypePager - List all global event subscriptions under an Azure subscription for a topic // type. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - topicTypeName - Name of the topic type. // - options - EventSubscriptionsClientListGlobalBySubscriptionForTopicTypeOptions contains the optional parameters for the // EventSubscriptionsClient.NewListGlobalBySubscriptionForTopicTypePager method. @@ -785,7 +785,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionForTopicTypeCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -809,7 +809,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -862,7 +862,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -886,7 +886,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -944,7 +944,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupForTopicTypeC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -967,7 +967,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupForTopicTypeH // NewListRegionalBySubscriptionPager - List all event subscriptions from the given location under a specific Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - location - Name of the location. // - options - EventSubscriptionsClientListRegionalBySubscriptionOptions contains the optional parameters for the EventSubscriptionsClient.NewListRegionalBySubscriptionPager // method. @@ -1015,7 +1015,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -1039,7 +1039,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - location - Name of the location. // - topicTypeName - Name of the topic type. // - options - EventSubscriptionsClientListRegionalBySubscriptionForTopicTypeOptions contains the optional parameters for the @@ -1092,7 +1092,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionForTopicTypeCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -1116,7 +1116,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 2022-06-15 +// Generated from API version 2023-06-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}' @@ -1144,7 +1144,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *EventSubscriptionsClient) update(ctx context.Context, scope string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *EventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, scope, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -1173,7 +1173,7 @@ func (client *EventSubscriptionsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) 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 d29b632a6357..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 37dceb2e5a78..2044c89f1c93 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/extensiontopics_client.go @@ -44,7 +44,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 2022-06-15 +// Generated from API version 2023-06-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}' @@ -79,7 +79,7 @@ func (client *ExtensionTopicsClient) getCreateRequest(ctx context.Context, scope return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-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 ac28b290d5d2..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/go.mod b/sdk/resourcemanager/eventgrid/armeventgrid/go.mod index bf4967ce3a03..e15916f54147 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/go.mod +++ b/sdk/resourcemanager/eventgrid/armeventgrid/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/models.go b/sdk/resourcemanager/eventgrid/armeventgrid/models.go index fa7203398c3d..deeaf01513e5 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/models.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/models.go @@ -39,6 +39,32 @@ type AdvancedFilter struct { // GetAdvancedFilter implements the AdvancedFilterClassification interface for type AdvancedFilter. func (a *AdvancedFilter) GetAdvancedFilter() *AdvancedFilter { return a } +// AzureADPartnerClientAuthentication - Azure Active Directory Partner Client Authentication +type AzureADPartnerClientAuthentication struct { + // REQUIRED; Type of client authentication + ClientAuthenticationType *PartnerClientAuthenticationType + + // AzureAD 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 an Azure Active Directory Partner Client Authentication. +type AzureADPartnerClientAuthenticationProperties struct { + // The Azure Active Directory 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. + 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. @@ -91,6 +117,104 @@ func (b *BoolEqualsAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// BoolEqualsFilter - BoolEquals Filter. +type BoolEqualsFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The boolean filter value. + Value *bool +} + +// GetFilter implements the FilterClassification interface for type BoolEqualsFilter. +func (b *BoolEqualsFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: b.OperatorType, + Key: b.Key, + } +} + +// CaCertificate - The CA Certificate resource. +type CaCertificate struct { + // The properties of CA certificate. + Properties *CaCertificateProperties + + // 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 CaCertificate resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// CaCertificateProperties - The properties of CA certificate. +type CaCertificateProperties struct { + // Description for the CA Certificate resource. + Description *string + + // Base64 encoded PEM (Privacy Enhanced Mail) format certificate data. + EncodedCertificate *string + + // READ-ONLY; Certificate expiry time in UTC. This is a read-only field. + ExpiryTimeInUTC *time.Time + + // READ-ONLY; Certificate issue time in UTC. This is a read-only field. + IssueTimeInUTC *time.Time + + // READ-ONLY; Provisioning state of the CA Certificate resource. + ProvisioningState *CaCertificateProvisioningState +} + +// CaCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CaCertificatesClient.BeginCreateOrUpdate +// method. +type CaCertificatesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CaCertificatesClientBeginDeleteOptions contains the optional parameters for the CaCertificatesClient.BeginDelete method. +type CaCertificatesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CaCertificatesClientGetOptions contains the optional parameters for the CaCertificatesClient.Get method. +type CaCertificatesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CaCertificatesClientListByNamespaceOptions contains the optional parameters for the CaCertificatesClient.NewListByNamespacePager +// method. +type CaCertificatesClientListByNamespaceOptions 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 +} + +// CaCertificatesListResult - Result of the List CA Certificate operation. +type CaCertificatesListResult struct { + // A link for the next page of CA Certificate. + NextLink *string + + // A collection of CA Certificate. + Value []*CaCertificate +} + // Channel info. type Channel struct { // Properties of the Channel. @@ -121,6 +245,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 @@ -145,6 +273,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 } @@ -199,6 +330,214 @@ type ChannelsListResult struct { Value []*Channel } +// Client - The Client resource. +type Client struct { + // The properties of client. + Properties *ClientProperties + + // 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 Client resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// ClientAuthentication - The Authentication properties for the client. +type ClientAuthentication struct { + // The CA certificate subject name used for authentication. + CertificateSubject *ClientCertificateSubjectDistinguishedName + + // The self signed certificate's thumbprints data used for authentication. + CertificateThumbprint *ClientCertificateThumbprint +} + +// ClientAuthenticationSettings - Client authentication settings for namespace resource. +type ClientAuthenticationSettings struct { + // Alternative authentication name sources related to client authentication settings for namespace resource. + AlternativeAuthenticationNameSources []*AlternativeAuthenticationNameSource +} + +// 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 + // is 'ThumbprintMatch'. + AllowedThumbprints []*string + + // The validation scheme used to authenticate the client. Default value is SubjectMatchesAuthenticationName. + ValidationScheme *ClientCertificateValidationScheme +} + +// ClientCertificateSubjectDistinguishedName - CA certificate subject distinguished name information used by service to authenticate +// clients. For more information, see +// https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x500distinguishedname?view=net-6.0#remarks +type ClientCertificateSubjectDistinguishedName struct { + // The common name field in the subject name. The allowed limit is 64 characters and it should be specified. + CommonName *string + + // The country code field in the subject name. If present, the country code should be represented by two-letter code defined + // in ISO 2166-1 (alpha-2). For example: 'US'. + CountryCode *string + + // The organization field in the subject name. If present, the allowed limit is 64 characters. + Organization *string + + // The organization unit field in the subject name. If present, the allowed limit is 32 characters. + OrganizationUnit *string +} + +// ClientCertificateThumbprint - Thumbprints are used by the service to validate the device permission when authentication +// is done using self signed certificate. +type ClientCertificateThumbprint struct { + // The primary thumbprint used for validation. + Primary *string + + // The secondary thumbprint used for validation. + Secondary *string +} + +// ClientGroup - The Client group resource. +type ClientGroup struct { + // The properties of client group. + Properties *ClientGroupProperties + + // 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 ClientGroup resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// ClientGroupProperties - The properties of client group. +type ClientGroupProperties struct { + // Description for the Client Group resource. + Description *string + + // The grouping query for the clients. Example : attributes.keyName IN ['a', 'b', 'c']. + Query *string + + // READ-ONLY; Provisioning state of the ClientGroup resource. + ProvisioningState *ClientGroupProvisioningState +} + +// ClientGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClientGroupsClient.BeginCreateOrUpdate +// method. +type ClientGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClientGroupsClientBeginDeleteOptions contains the optional parameters for the ClientGroupsClient.BeginDelete method. +type ClientGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClientGroupsClientGetOptions contains the optional parameters for the ClientGroupsClient.Get method. +type ClientGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClientGroupsClientListByNamespaceOptions contains the optional parameters for the ClientGroupsClient.NewListByNamespacePager +// method. +type ClientGroupsClientListByNamespaceOptions 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 +} + +// ClientGroupsListResult - Result of the List Client Group operation. +type ClientGroupsListResult struct { + // A link for the next page of Client Group. + NextLink *string + + // A collection of Client Group. + Value []*ClientGroup +} + +// ClientProperties - The properties of client. +type ClientProperties struct { + // Attributes for the client. Supported values are int, bool, string, string[]. Example: "attributes": { "room": "345", "floor": + // 12, "deviceTypes": ["Fan", "Light"] } + Attributes map[string]any + + // Authentication information for the client. + Authentication *ClientAuthentication + + // The name presented by the client for authentication. The default value is the name of the resource. + AuthenticationName *string + + // The client certificate authentication information. + ClientCertificateAuthentication *ClientCertificateAuthentication + + // Description for the Client resource. + Description *string + + // Indicates if the client is enabled or not. Default value is Enabled. + State *ClientState + + // READ-ONLY; Provisioning state of the Client resource. + ProvisioningState *ClientProvisioningState +} + +// ClientsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClientsClient.BeginCreateOrUpdate method. +type ClientsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClientsClientBeginDeleteOptions contains the optional parameters for the ClientsClient.BeginDelete method. +type ClientsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClientsClientGetOptions contains the optional parameters for the ClientsClient.Get method. +type ClientsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClientsClientListByNamespaceOptions contains the optional parameters for the ClientsClient.NewListByNamespacePager method. +type ClientsClientListByNamespaceOptions 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 +} + +// ClientsListResult - Result of the List Client operation. +type ClientsListResult struct { + // A link for the next page of Client. + NextLink *string + + // A collection of Client. + Value []*Client +} + // ConnectionState information. type ConnectionState struct { // Actions required (if any). @@ -269,6 +608,15 @@ type DeliveryAttributeMapping struct { // GetDeliveryAttributeMapping implements the DeliveryAttributeMappingClassification interface for type DeliveryAttributeMapping. func (d *DeliveryAttributeMapping) GetDeliveryAttributeMapping() *DeliveryAttributeMapping { return d } +// DeliveryConfiguration - Properties of the delivery configuration information of the event subscription. +type DeliveryConfiguration struct { + // Delivery mode of the event subscription. + DeliveryMode *DeliveryMode + + // This property should be populated when deliveryMode is queue and represents information about the queue subscription. + Queue *QueueInfo +} + // DeliveryWithResourceIdentity - Information about the delivery for an event subscription with resource identity. type DeliveryWithResourceIdentity struct { // Information about the destination where events have to be delivered for the event subscription. Uses Azure Event Grid's @@ -291,6 +639,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 @@ -393,6 +744,10 @@ type DomainProperties struct { // 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 + // to view different types of events that are published. + EventTypeInfo *EventTypeInfo + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess // is enabled. InboundIPRules []*InboundIPRule @@ -403,6 +758,9 @@ type DomainProperties struct { // Information about the InputSchemaMapping which specified the info about mapping event payload. InputSchemaMapping InputSchemaMappingClassification + // Minimum TLS version of the publisher allowed to publish to this domain + MinimumTLSVersionAllowed *TLSVersion + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific // IPs by configuring PublicNetworkAccess *PublicNetworkAccess @@ -413,7 +771,7 @@ type DomainProperties struct { // READ-ONLY; Metric resource id for the Event Grid Domain Resource. MetricResourceID *string - // READ-ONLY; List of private endpoint connections. + // READ-ONLY PrivateEndpointConnections []*PrivateEndpointConnection // READ-ONLY; Provisioning state of the Event Grid Domain Resource. @@ -588,10 +946,16 @@ type DomainUpdateParameterProperties struct { // token will be used to authenticate if user is allowed to publish to the domain. DisableLocalAuth *bool + // The eventTypeInfo for the domain. + EventTypeInfo *EventTypeInfo + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess // is enabled. InboundIPRules []*InboundIPRule + // Minimum TLS version of the publisher allowed to publish to this domain + MinimumTLSVersionAllowed *TLSVersion + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific // IPs by configuring PublicNetworkAccess *PublicNetworkAccess @@ -605,6 +969,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 } @@ -707,6 +1074,48 @@ type DynamicDeliveryAttributeMappingProperties struct { SourceField *string } +type DynamicRoutingEnrichment struct { + // Dynamic routing enrichment key. + Key *string + + // Dynamic routing enrichment value. + Value *string +} + +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail +} + // EventHubEventSubscriptionDestination - Information about the event hub destination for an event subscription. type EventHubEventSubscriptionDestination struct { // REQUIRED; Type of the endpoint for the event subscription destination. @@ -732,7 +1141,7 @@ type EventHubEventSubscriptionDestinationProperties struct { ResourceID *string } -// EventSubscription - Event Subscription +// EventSubscription - Event Subscription. type EventSubscription struct { // Properties of the event subscription. Properties *EventSubscriptionProperties @@ -754,8 +1163,8 @@ type EventSubscription struct { // 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, -// - *ServiceBusQueueEventSubscriptionDestination, *ServiceBusTopicEventSubscriptionDestination, *StorageQueueEventSubscriptionDestination, -// - *WebHookEventSubscriptionDestination +// - *PartnerEventSubscriptionDestination, *ServiceBusQueueEventSubscriptionDestination, *ServiceBusTopicEventSubscriptionDestination, +// - *StorageQueueEventSubscriptionDestination, *WebHookEventSubscriptionDestination type EventSubscriptionDestinationClassification interface { // GetEventSubscriptionDestination returns the EventSubscriptionDestination content of the underlying type. GetEventSubscriptionDestination() *EventSubscriptionDestination @@ -1141,9 +1550,18 @@ 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 + // Properties of the extension topic. Properties *ExtensionTopicProperties // READ-ONLY; Fully qualified identifier of the resource. @@ -1173,6 +1591,42 @@ type ExtensionTopicsClientGetOptions struct { // placeholder for future optional parameters } +// FilterClassification provides polymorphic access to related types. +// Call the interface's GetFilter() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BoolEqualsFilter, *Filter, *IsNotNullFilter, *IsNullOrUndefinedFilter, *NumberGreaterThanFilter, *NumberGreaterThanOrEqualsFilter, +// - *NumberInFilter, *NumberInRangeFilter, *NumberLessThanFilter, *NumberLessThanOrEqualsFilter, *NumberNotInFilter, *NumberNotInRangeFilter, +// - *StringBeginsWithFilter, *StringContainsFilter, *StringEndsWithFilter, *StringInFilter, *StringNotBeginsWithFilter, *StringNotContainsFilter, +// - *StringNotEndsWithFilter, *StringNotInFilter +type FilterClassification interface { + // GetFilter returns the Filter content of the underlying type. + GetFilter() *Filter +} + +// 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, StringEqualsFilter etc depending on the type of the key based on which you want to filter. +type Filter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string +} + +// GetFilter implements the FilterClassification interface for type Filter. +func (f *Filter) GetFilter() *Filter { return f } + +// FiltersConfiguration - Filters configuration for the Event Subscription. +type FiltersConfiguration struct { + // An array of filters that are used for filtering event subscriptions. + Filters []FilterClassification + + // A list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default + // event types, set the IncludedEventTypes to null. + IncludedEventTypes []*string +} + // HybridConnectionEventSubscriptionDestination - Information about the HybridConnection destination for an event subscription. type HybridConnectionEventSubscriptionDestination struct { // REQUIRED; Type of the endpoint for the event subscription destination. @@ -1278,6 +1732,23 @@ func (i *IsNotNullAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// IsNotNullFilter - IsNotNull Filter. +type IsNotNullFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string +} + +// GetFilter implements the FilterClassification interface for type IsNotNullFilter. +func (i *IsNotNullFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: i.OperatorType, + Key: i.Key, + } +} + // IsNullOrUndefinedAdvancedFilter - IsNullOrUndefined Advanced Filter. type IsNullOrUndefinedAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1295,11 +1766,28 @@ func (i *IsNullOrUndefinedAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } -// 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. -type JSONField struct { - // Name of a field in the input event schema that's to be used as the source of a mapping. +// IsNullOrUndefinedFilter - IsNullOrUndefined Filter. +type IsNullOrUndefinedFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string +} + +// GetFilter implements the FilterClassification interface for type IsNullOrUndefinedFilter. +func (i *IsNullOrUndefinedFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: i.OperatorType, + Key: i.Key, + } +} + +// 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. +type JSONField struct { + // Name of a field in the input event schema that's to be used as the source of a mapping. SourceField *string } @@ -1355,6 +1843,345 @@ type JSONInputSchemaMappingProperties struct { Topic *JSONField } +// Namespace resource. +type Namespace struct { + // REQUIRED; Location of the resource. + Location *string + + // Identity information for the Namespace resource. + Identity *IdentityInfo + + // Properties of the Namespace resource. + Properties *NamespaceProperties + + // Represents available Sku pricing tiers. + SKU *NamespaceSKU + + // 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 namespace resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// NamespaceProperties - Properties of the namespace resource. +type NamespaceProperties struct { + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + // is enabled. + InboundIPRules []*InboundIPRule + + // Allows the user to specify if the service is zone-redundant. This is a required property and user needs to specify this + // value explicitly. Once specified, this property cannot be updated. + IsZoneRedundant *bool + + // Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2 is supported. + MinimumTLSVersionAllowed *TLSVersion + PrivateEndpointConnections []*PrivateEndpointConnection + + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + // IPs by configuring + PublicNetworkAccess *PublicNetworkAccess + + // Topic spaces configuration information for the namespace resource + TopicSpacesConfiguration *TopicSpacesConfiguration + + // Topics configuration information for the namespace resource + TopicsConfiguration *TopicsConfiguration + + // READ-ONLY; Provisioning state of the namespace resource. + ProvisioningState *NamespaceProvisioningState +} + +// NamespaceRegenerateKeyRequest - Namespace regenerate share access key request. +type NamespaceRegenerateKeyRequest struct { + // REQUIRED; Key name to regenerate key1 or key2. + KeyName *string +} + +// NamespaceSKU - Represents available Sku pricing tiers. +type NamespaceSKU struct { + // Specifies the number of Throughput Units that defines the capacity for the namespace. The property default value is 1 which + // signifies 1 Throughput Unit = 1MB/s ingress and 2MB/s egress per namespace. + // Min capacity is 1 and max allowed capacity is 20. + Capacity *int32 + + // The name of the SKU. + Name *SKUName +} + +// NamespaceSharedAccessKeys - Shared access keys of the Namespace. +type NamespaceSharedAccessKeys struct { + // Shared access key1 for the namespace. + Key1 *string + + // Shared access key2 for the namespace. + Key2 *string +} + +// NamespaceTopic - Namespace topic details. +type NamespaceTopic struct { + // Properties of the namespace topic. + Properties *NamespaceTopicProperties + + // 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 namespace topic resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +type NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespaceTopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.BeginDelete +// method. +type NamespaceTopicEventSubscriptionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespaceTopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.BeginUpdate +// method. +type NamespaceTopicEventSubscriptionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespaceTopicEventSubscriptionsClientGetOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.Get +// method. +type NamespaceTopicEventSubscriptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NamespaceTopicEventSubscriptionsClientListByNamespaceTopicOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.NewListByNamespaceTopicPager +// method. +type NamespaceTopicEventSubscriptionsClientListByNamespaceTopicOptions 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 +} + +// NamespaceTopicProperties - Properties of the namespace topic. +type NamespaceTopicProperties struct { + // Event retention for the namespace topic expressed in days. The property default value is 1 day. Min event retention duration + // value is 1 day and max event retention duration value is 1 day. + EventRetentionInDays *int32 + + // This determines the format that is expected for incoming events published to the topic. + InputSchema *EventInputSchema + + // Publisher type of the namespace topic. + PublisherType *PublisherType + + // READ-ONLY; Provisioning state of the namespace topic. + ProvisioningState *NamespaceTopicProvisioningState +} + +// NamespaceTopicUpdateParameterProperties - Information of namespace topic update parameter properties. +type NamespaceTopicUpdateParameterProperties struct { + // Event retention for the namespace topic expressed in days. The property default value is 1 day. Min event retention duration + // value is 1 day and max event retention duration value is 1 day. + EventRetentionInDays *int32 +} + +// NamespaceTopicUpdateParameters - Properties of the namespace topic update. +type NamespaceTopicUpdateParameters struct { + // Properties of the namespace topic resource. + Properties *NamespaceTopicUpdateParameterProperties +} + +// NamespaceTopicsClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespaceTopicsClient.BeginCreateOrUpdate +// method. +type NamespaceTopicsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespaceTopicsClientBeginDeleteOptions contains the optional parameters for the NamespaceTopicsClient.BeginDelete method. +type NamespaceTopicsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespaceTopicsClientBeginRegenerateKeyOptions contains the optional parameters for the NamespaceTopicsClient.BeginRegenerateKey +// method. +type NamespaceTopicsClientBeginRegenerateKeyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespaceTopicsClientBeginUpdateOptions contains the optional parameters for the NamespaceTopicsClient.BeginUpdate method. +type NamespaceTopicsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespaceTopicsClientGetOptions contains the optional parameters for the NamespaceTopicsClient.Get method. +type NamespaceTopicsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NamespaceTopicsClientListByNamespaceOptions contains the optional parameters for the NamespaceTopicsClient.NewListByNamespacePager +// method. +type NamespaceTopicsClientListByNamespaceOptions 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 +} + +// NamespaceTopicsClientListSharedAccessKeysOptions contains the optional parameters for the NamespaceTopicsClient.ListSharedAccessKeys +// method. +type NamespaceTopicsClientListSharedAccessKeysOptions struct { + // placeholder for future optional parameters +} + +// NamespaceTopicsListResult - Result of the List namespace topics operation. +type NamespaceTopicsListResult struct { + // A link for the next page of namespace topics. + NextLink *string + + // A collection of namespace topics. + Value []*NamespaceTopic +} + +// NamespaceUpdateParameterProperties - Information of namespace update parameter properties. +type NamespaceUpdateParameterProperties struct { + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + // is enabled. + InboundIPRules []*InboundIPRule + + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + // IPs by configuring + PublicNetworkAccess *PublicNetworkAccess + + // Topic spaces configuration properties that can be updated. + TopicSpacesConfiguration *UpdateTopicSpacesConfigurationInfo +} + +// NamespaceUpdateParameters - Properties to update namespace. +type NamespaceUpdateParameters struct { + // Namespace resource identity information. + Identity *IdentityInfo + + // Properties of the namespace resource. + Properties *NamespaceUpdateParameterProperties + + // Represents available Sku pricing tiers. + SKU *NamespaceSKU + + // Tags of the namespace resource. + Tags map[string]*string +} + +// NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate +// method. +type NamespacesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. +type NamespacesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespacesClientBeginRegenerateKeyOptions contains the optional parameters for the NamespacesClient.BeginRegenerateKey +// method. +type NamespacesClientBeginRegenerateKeyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespacesClientBeginUpdateOptions contains the optional parameters for the NamespacesClient.BeginUpdate method. +type NamespacesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamespacesClientGetOptions contains the optional parameters for the NamespacesClient.Get method. +type NamespacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.NewListByResourceGroupPager +// method. +type NamespacesClientListByResourceGroupOptions 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 +} + +// NamespacesClientListBySubscriptionOptions contains the optional parameters for the NamespacesClient.NewListBySubscriptionPager +// method. +type NamespacesClientListBySubscriptionOptions 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 +} + +// NamespacesClientListSharedAccessKeysOptions contains the optional parameters for the NamespacesClient.ListSharedAccessKeys +// method. +type NamespacesClientListSharedAccessKeysOptions struct { + // placeholder for future optional parameters +} + +// NamespacesListResult - Result of the List Namespaces operation. +type NamespacesListResult struct { + // A link for the next page of namespaces. + NextLink *string + + // A collection of namespaces. + Value []*Namespace +} + // NumberGreaterThanAdvancedFilter - NumberGreaterThan Advanced Filter. type NumberGreaterThanAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1375,6 +2202,26 @@ func (n *NumberGreaterThanAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// NumberGreaterThanFilter - NumberGreaterThan Filter. +type NumberGreaterThanFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The filter value. + Value *float64 +} + +// GetFilter implements the FilterClassification interface for type NumberGreaterThanFilter. +func (n *NumberGreaterThanFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + // NumberGreaterThanOrEqualsAdvancedFilter - NumberGreaterThanOrEquals Advanced Filter. type NumberGreaterThanOrEqualsAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1395,6 +2242,26 @@ func (n *NumberGreaterThanOrEqualsAdvancedFilter) GetAdvancedFilter() *AdvancedF } } +// NumberGreaterThanOrEqualsFilter - NumberGreaterThanOrEquals Filter. +type NumberGreaterThanOrEqualsFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The filter value. + Value *float64 +} + +// GetFilter implements the FilterClassification interface for type NumberGreaterThanOrEqualsFilter. +func (n *NumberGreaterThanOrEqualsFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + // NumberInAdvancedFilter - NumberIn Advanced Filter. type NumberInAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1415,6 +2282,26 @@ func (n *NumberInAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// NumberInFilter - NumberIn Filter. +type NumberInFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*float64 +} + +// GetFilter implements the FilterClassification interface for type NumberInFilter. +func (n *NumberInFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + // NumberInRangeAdvancedFilter - NumberInRange Advanced Filter. type NumberInRangeAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1427,9 +2314,29 @@ type NumberInRangeAdvancedFilter struct { Values [][]*float64 } -// GetAdvancedFilter implements the AdvancedFilterClassification interface for type NumberInRangeAdvancedFilter. -func (n *NumberInRangeAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { - return &AdvancedFilter{ +// GetAdvancedFilter implements the AdvancedFilterClassification interface for type NumberInRangeAdvancedFilter. +func (n *NumberInRangeAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { + return &AdvancedFilter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + +// NumberInRangeFilter - NumberInRange Filter. +type NumberInRangeFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values [][]*float64 +} + +// GetFilter implements the FilterClassification interface for type NumberInRangeFilter. +func (n *NumberInRangeFilter) GetFilter() *Filter { + return &Filter{ OperatorType: n.OperatorType, Key: n.Key, } @@ -1455,6 +2362,26 @@ func (n *NumberLessThanAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// NumberLessThanFilter - NumberLessThan Filter. +type NumberLessThanFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The filter value. + Value *float64 +} + +// GetFilter implements the FilterClassification interface for type NumberLessThanFilter. +func (n *NumberLessThanFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + // NumberLessThanOrEqualsAdvancedFilter - NumberLessThanOrEquals Advanced Filter. type NumberLessThanOrEqualsAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1475,6 +2402,26 @@ func (n *NumberLessThanOrEqualsAdvancedFilter) GetAdvancedFilter() *AdvancedFilt } } +// NumberLessThanOrEqualsFilter - NumberLessThanOrEquals Filter. +type NumberLessThanOrEqualsFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The filter value. + Value *float64 +} + +// GetFilter implements the FilterClassification interface for type NumberLessThanOrEqualsFilter. +func (n *NumberLessThanOrEqualsFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + // NumberNotInAdvancedFilter - NumberNotIn Advanced Filter. type NumberNotInAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1495,6 +2442,26 @@ func (n *NumberNotInAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// NumberNotInFilter - NumberNotIn Filter. +type NumberNotInFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*float64 +} + +// GetFilter implements the FilterClassification interface for type NumberNotInFilter. +func (n *NumberNotInFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + // NumberNotInRangeAdvancedFilter - NumberNotInRange Advanced Filter. type NumberNotInRangeAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -1515,6 +2482,26 @@ func (n *NumberNotInRangeAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// NumberNotInRangeFilter - NumberNotInRange Filter. +type NumberNotInRangeFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values [][]*float64 +} + +// GetFilter implements the FilterClassification interface for type NumberNotInRangeFilter. +func (n *NumberNotInRangeFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: n.OperatorType, + Key: n.Key, + } +} + // Operation - Represents an operation returned by the GetOperations request. type Operation struct { // Display name of the operation. @@ -1586,6 +2573,26 @@ type PartnerAuthorization struct { DefaultMaximumExpirationTimeInDays *int32 } +// 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 +} + +// 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. @@ -1703,6 +2710,166 @@ 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 Partner Destination resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// 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 +} + +// 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 +} + +// 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 LRO from the provided token. + ResumeToken string +} + +// PartnerDestinationsClientBeginDeleteOptions contains the optional parameters for the PartnerDestinationsClient.BeginDelete +// method. +type PartnerDestinationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerDestinationsClientBeginUpdateOptions contains the optional parameters for the PartnerDestinationsClient.BeginUpdate +// method. +type PartnerDestinationsClientBeginUpdateOptions struct { + // Resumes the LRO 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 +} + +// 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. @@ -1715,6 +2882,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. @@ -1750,6 +2937,9 @@ type PartnerNamespaceProperties struct { // is enabled. InboundIPRules []*InboundIPRule + // Minimum TLS version of the publisher allowed to publish to this partner namespace + MinimumTLSVersionAllowed *TLSVersion + // The fully qualified ARM Id of the partner registration that should be associated with this partner namespace. This takes // the following format: // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. @@ -1800,6 +2990,9 @@ type PartnerNamespaceUpdateParameterProperties struct { // is enabled. InboundIPRules []*InboundIPRule + // Minimum TLS version of the publisher allowed to publish to this domain + MinimumTLSVersionAllowed *TLSVersion + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific // IPs by configuring PublicNetworkAccess *PublicNetworkAccess @@ -2209,12 +3402,113 @@ type PartnerTopicsListResult struct { Value []*PartnerTopic } +// 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 +} + +// 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 EventTypeInfo *EventTypeInfo } +// PermissionBinding - The Permission binding resource. +type PermissionBinding struct { + // The properties of permission binding. + Properties *PermissionBindingProperties + + // 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 PermissionBinding resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// PermissionBindingProperties - The properties of permission binding. +type PermissionBindingProperties struct { + // The name of the client group resource that the permission is bound to. The client group needs to be a resource under the + // same namespace the permission binding is a part of. + ClientGroupName *string + + // Description for the Permission Binding resource. + Description *string + + // The allowed permission. + Permission *PermissionType + + // The name of the Topic Space resource that the permission is bound to. The Topic space needs to be a resource under the + // same namespace the permission binding is a part of. + TopicSpaceName *string + + // READ-ONLY; Provisioning state of the PermissionBinding resource. + ProvisioningState *PermissionBindingProvisioningState +} + +// PermissionBindingsClientBeginCreateOrUpdateOptions contains the optional parameters for the PermissionBindingsClient.BeginCreateOrUpdate +// method. +type PermissionBindingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PermissionBindingsClientBeginDeleteOptions contains the optional parameters for the PermissionBindingsClient.BeginDelete +// method. +type PermissionBindingsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PermissionBindingsClientGetOptions contains the optional parameters for the PermissionBindingsClient.Get method. +type PermissionBindingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PermissionBindingsClientListByNamespaceOptions contains the optional parameters for the PermissionBindingsClient.NewListByNamespacePager +// method. +type PermissionBindingsClientListByNamespaceOptions 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 +} + +// PermissionBindingsListResult - Result of the List Permission Binding operation. +type PermissionBindingsListResult struct { + // A link for the next page of Permission Binding. + NextLink *string + + // A collection of Permission Binding. + Value []*PermissionBinding +} + // PrivateEndpoint information. type PrivateEndpoint struct { // The ARM identifier for Private Endpoint. @@ -2345,6 +3639,41 @@ type PrivateLinkResourcesListResult struct { Value []*PrivateLinkResource } +// QueueInfo - Properties of the Queue info for event subscription. +type QueueInfo struct { + // The dead letter destination of the event subscription. Any event that cannot be delivered to its' destination is sent to + // the dead letter destination. Uses the managed identity setup on the parent + // resource (namely, topic) to acquire the authentication tokens being used during delivery / dead-lettering. + DeadLetterDestinationWithResourceIdentity *DeadLetterWithResourceIdentity + + // Time span duration in ISO 8601 format that determines how long messages are available to the subscription from the time + // the message was published. This duration value is expressed using the following + // format: \'P(n)Y(n)M(n)DT(n)H(n)M(n)S\', where: - (n) is replaced by the value of each time element that follows the (n). + // - P is the duration (or Period) designator and is always placed at the + // beginning of the duration. - Y is the year designator, and it follows the value for the number of years. - M is the month + // designator, and it follows the value for the number of months. - W is the week + // designator, and it follows the value for the number of weeks. - D is the day designator, and it follows the value for the + // number of days. - T is the time designator, and it precedes the time + // components. - H is the hour designator, and it follows the value for the number of hours. - M is the minute designator, + // and it follows the value for the number of minutes. - S is the second + // designator, and it follows the value for the number of seconds. This duration value cannot be set greater than the topic’s + // EventRetentionInDays. It is is an optional field where its minimum value is 1 + // minute, and its maximum is determined by topic’s EventRetentionInDays value. The followings are examples of valid values: + // - \'P0DT23H12M\' or \'PT23H12M\': for duration of 23 hours and 12 minutes. - + // \'P1D\' or \'P1DT0H0M0S\': for duration of 1 day. + EventTimeToLive *string + + // The maximum delivery count of the events. + MaxDeliveryCount *int32 + + // Maximum period in seconds in which once the message is in received (by the client) state and waiting to be accepted, released + // or rejected. If this time elapsed after a message has been received by the + // client and not transitioned into accepted (not processed), released or rejected, the message is available for redelivery. + // This is an optional field, where default is 60 seconds, minimum is 60 seconds + // and maximum is 300 seconds. + ReceiveLockDurationInSeconds *int32 +} + // Resource - Definition of a Resource. type Resource struct { // READ-ONLY; Fully qualified identifier of the resource. @@ -2357,6 +3686,24 @@ type Resource struct { Type *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. @@ -2366,6 +3713,17 @@ type RetryPolicy struct { MaxDeliveryAttempts *int32 } +type RoutingEnrichments struct { + Dynamic []*DynamicRoutingEnrichment + Static []*StaticRoutingEnrichment +} + +// RoutingIdentityInfo - Routing identity info for topic spaces configuration. +type RoutingIdentityInfo struct { + Type *RoutingIdentityType + UserAssignedIdentity *string +} + // ServiceBusQueueEventSubscriptionDestination - Information about the service bus destination for an event subscription. type ServiceBusQueueEventSubscriptionDestination struct { // REQUIRED; Type of the endpoint for the event subscription destination. @@ -2447,6 +3805,14 @@ type StaticDeliveryAttributeMappingProperties struct { Value *string } +type StaticRoutingEnrichment struct { + // Static routing enrichment key. + Key *string + + // Static routing enrichment value type. For e.g. this property value can be 'String'. + ValueType *StaticRoutingEnrichmentType +} + // StorageBlobDeadLetterDestination - Information about the storage blob based dead letter destination. type StorageBlobDeadLetterDestination struct { // REQUIRED; Type of the endpoint for the dead letter destination @@ -2490,7 +3856,8 @@ func (s *StorageQueueEventSubscriptionDestination) GetEventSubscriptionDestinati // StorageQueueEventSubscriptionDestinationProperties - The properties for a storage queue destination. type StorageQueueEventSubscriptionDestinationProperties struct { - // Storage queue message time to live in seconds. + // Storage queue message time to live in seconds. This value cannot be zero or negative with the exception of using -1 to + // indicate that the Time To Live of the message is Infinite. QueueMessageTimeToLiveInSeconds *int64 // The name of the Storage queue under a storage account that is the destination of an event subscription. @@ -2520,6 +3887,26 @@ func (s *StringBeginsWithAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// StringBeginsWithFilter - StringBeginsWith Filter. +type StringBeginsWithFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringBeginsWithFilter. +func (s *StringBeginsWithFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + // StringContainsAdvancedFilter - StringContains Advanced Filter. type StringContainsAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -2540,6 +3927,26 @@ func (s *StringContainsAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// StringContainsFilter - StringContains Filter. +type StringContainsFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringContainsFilter. +func (s *StringContainsFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + // StringEndsWithAdvancedFilter - StringEndsWith Advanced Filter. type StringEndsWithAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -2560,6 +3967,26 @@ func (s *StringEndsWithAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// StringEndsWithFilter - StringEndsWith Filter. +type StringEndsWithFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringEndsWithFilter. +func (s *StringEndsWithFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + // StringInAdvancedFilter - StringIn Advanced Filter. type StringInAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -2580,6 +4007,26 @@ func (s *StringInAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// StringInFilter - StringIn Filter. +type StringInFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringInFilter. +func (s *StringInFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + // StringNotBeginsWithAdvancedFilter - StringNotBeginsWith Advanced Filter. type StringNotBeginsWithAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -2600,6 +4047,26 @@ func (s *StringNotBeginsWithAdvancedFilter) GetAdvancedFilter() *AdvancedFilter } } +// StringNotBeginsWithFilter - StringNotBeginsWith Filter. +type StringNotBeginsWithFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringNotBeginsWithFilter. +func (s *StringNotBeginsWithFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + // StringNotContainsAdvancedFilter - StringNotContains Advanced Filter. type StringNotContainsAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -2620,6 +4087,26 @@ func (s *StringNotContainsAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// StringNotContainsFilter - StringNotContains Filter. +type StringNotContainsFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringNotContainsFilter. +func (s *StringNotContainsFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + // StringNotEndsWithAdvancedFilter - StringNotEndsWith Advanced Filter. type StringNotEndsWithAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -2640,6 +4127,26 @@ func (s *StringNotEndsWithAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// StringNotEndsWithFilter - StringNotEndsWith Filter. +type StringNotEndsWithFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringNotEndsWithFilter. +func (s *StringNotEndsWithFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + // StringNotInAdvancedFilter - StringNotIn Advanced Filter. type StringNotInAdvancedFilter struct { // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -2660,6 +4167,86 @@ func (s *StringNotInAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// StringNotInFilter - StringNotIn Filter. +type StringNotInFilter struct { + // REQUIRED; The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. + OperatorType *FilterOperatorType + + // The field/property in the event based on which you want to filter. + Key *string + + // The set of filter values. + Values []*string +} + +// GetFilter implements the FilterClassification interface for type StringNotInFilter. +func (s *StringNotInFilter) GetFilter() *Filter { + return &Filter{ + OperatorType: s.OperatorType, + Key: s.Key, + } +} + +// Subscription - Event Subscription. +type Subscription struct { + // Properties of the event subscription. + Properties *SubscriptionProperties + + // 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 Event Subscription resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// SubscriptionProperties - Properties of the event subscription. +type SubscriptionProperties struct { + // Information about the delivery configuration of the event subscription. + DeliveryConfiguration *DeliveryConfiguration + + // The event delivery schema for the event subscription. + EventDeliverySchema *DeliverySchema + + // Information about the filter for the event subscription. + FiltersConfiguration *FiltersConfiguration + + // READ-ONLY; Provisioning state of the event subscription. + ProvisioningState *SubscriptionProvisioningState +} + +// SubscriptionUpdateParameters - Properties of the Event Subscription update. +type SubscriptionUpdateParameters struct { + // Properties of the Event Subscription update parameters. + Properties *SubscriptionUpdateParametersProperties +} + +// SubscriptionUpdateParametersProperties - Properties of the Event Subscription update parameters. +type SubscriptionUpdateParametersProperties struct { + // Information about the delivery configuration of the event subscription. + DeliveryConfiguration *DeliveryConfiguration + + // The event delivery schema for the event subscription. + EventDeliverySchema *DeliverySchema + + // Information about the filter for the event subscription. + FiltersConfiguration *FiltersConfiguration +} + +// SubscriptionsListResult - Result of the List event subscriptions operation. +type SubscriptionsListResult struct { + // A link for the next page of event subscriptions + NextLink *string + + // A collection of Subscriptions. + Value []*Subscription +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -2854,12 +4441,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 @@ -2938,6 +4534,10 @@ type TopicProperties struct { // 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 + // to view different types of events that are published. + EventTypeInfo *EventTypeInfo + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess // is enabled. InboundIPRules []*InboundIPRule @@ -2949,6 +4549,9 @@ type TopicProperties struct { // a source schema to various required properties of the EventGridEvent schema. InputSchemaMapping InputSchemaMappingClassification + // Minimum TLS version of the publisher allowed to publish to this topic + MinimumTLSVersionAllowed *TLSVersion + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific // IPs by configuring PublicNetworkAccess *PublicNetworkAccess @@ -2981,6 +4584,111 @@ type TopicSharedAccessKeys struct { Key2 *string } +// TopicSpace - The Topic space resource. +type TopicSpace struct { + // The properties of topic space. + Properties *TopicSpaceProperties + + // 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 TopicSpace resource. + SystemData *SystemData + + // READ-ONLY; Type of the resource. + Type *string +} + +// TopicSpaceProperties - The properties of topic space. +type TopicSpaceProperties struct { + // Description for the Topic Space resource. + Description *string + + // The topic filters in the topic space. Example: "topicTemplates": [ "devices/foo/bar", "devices/topic1/+", "devices/${principal.name}/${principal.attributes.keyName}" + // ]. + TopicTemplates []*string + + // READ-ONLY; Provisioning state of the TopicSpace resource. + ProvisioningState *TopicSpaceProvisioningState +} + +// TopicSpacesClientBeginCreateOrUpdateOptions contains the optional parameters for the TopicSpacesClient.BeginCreateOrUpdate +// method. +type TopicSpacesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TopicSpacesClientBeginDeleteOptions contains the optional parameters for the TopicSpacesClient.BeginDelete method. +type TopicSpacesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TopicSpacesClientGetOptions contains the optional parameters for the TopicSpacesClient.Get method. +type TopicSpacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// TopicSpacesClientListByNamespaceOptions contains the optional parameters for the TopicSpacesClient.NewListByNamespacePager +// method. +type TopicSpacesClientListByNamespaceOptions 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 +} + +// TopicSpacesConfiguration - Properties of the Topic Spaces Configuration. +type TopicSpacesConfiguration struct { + // Client authentication settings for topic spaces configuration. + ClientAuthentication *ClientAuthenticationSettings + + // The maximum number of sessions per authentication name. The property default value is 1. Min allowed value is 1 and max + // allowed value is 100. + MaximumClientSessionsPerAuthenticationName *int32 + + // The maximum session expiry in hours. The property default value is 1 hour. Min allowed value is 1 hour and max allowed + // value is 8 hours. + MaximumSessionExpiryInHours *int32 + + // Fully qualified Azure Resource Id for the Event Grid Topic to which events will be routed to from TopicSpaces under a namespace. + // This property should be in the following format + // '/subscriptions/{subId}/resourcegroups/{resourceGroupName}/providers/microsoft.EventGrid/topics/{topicName}'. This topic + // should reside in the same region where namespace is located. + RouteTopicResourceID *string + + // Routing enrichments for topic spaces configuration + RoutingEnrichments *RoutingEnrichments + + // Routing identity info for topic spaces configuration. + RoutingIdentityInfo *RoutingIdentityInfo + + // Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled. + State *TopicSpacesConfigurationState + + // READ-ONLY; The endpoint for the topic spaces configuration. This is a read-only property. + Hostname *string +} + +// TopicSpacesListResult - Result of the List Topic Space operation. +type TopicSpacesListResult struct { + // A link for the next page of Topic Space. + NextLink *string + + // A collection of Topic Space. + Value []*TopicSpace +} + // TopicTypeInfo - Properties of a topic type info. type TopicTypeInfo struct { // Properties of the topic type info @@ -2998,6 +4706,9 @@ type TopicTypeInfo struct { // TopicTypeProperties - Properties of a topic type. type TopicTypeProperties struct { + // Flag to indicate that a topic type can support both regional or global system topics + AreRegionalAndGlobalSourcesSupported *bool + // Description of the topic type. Description *string @@ -3054,10 +4765,16 @@ type TopicUpdateParameterProperties struct { // token will be used to authenticate if user is allowed to publish to the topic. DisableLocalAuth *bool + // The eventTypeInfo for the topic. + EventTypeInfo *EventTypeInfo + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess // is enabled. InboundIPRules []*InboundIPRule + // Minimum TLS version of the publisher allowed to publish to this domain + MinimumTLSVersionAllowed *TLSVersion + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific // IPs by configuring PublicNetworkAccess *PublicNetworkAccess @@ -3071,6 +4788,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 } @@ -3144,6 +4864,12 @@ type TopicsClientListSharedAccessKeysOptions struct { // placeholder for future optional parameters } +// TopicsConfiguration - Properties of the Topics Configuration. +type TopicsConfiguration struct { + // READ-ONLY; The hostname for the topics configuration. This is a read-only property. + Hostname *string +} + // TopicsListResult - Result of the List Topics operation type TopicsListResult struct { // A link for the next page of topics @@ -3171,6 +4897,32 @@ type TrackedResource struct { Type *string } +// UpdateTopicSpacesConfigurationInfo - Properties of the topic spaces configuration info of a namespace. +type UpdateTopicSpacesConfigurationInfo struct { + // Client authentication settings for topic spaces configuration. + ClientAuthentication *ClientAuthenticationSettings + + // The maximum number of sessions per authentication name. The property default value is 1. Min allowed value is 1 and max + // allowed value is 100. + MaximumClientSessionsPerAuthenticationName *int32 + + // The maximum session expiry in hours. The property default value is 1 hour. Min allowed value is 1 hour and max allowed + // value is 8 hours. + MaximumSessionExpiryInHours *int32 + + // This property is used to specify custom topic to which events will be routed to from topic spaces configuration under namespace. + RouteTopicResourceID *string + + // Routing enrichments for topic spaces configuration. + RoutingEnrichments *RoutingEnrichments + + // Routing identity info for topic spaces configuration. + RoutingIdentityInfo *RoutingIdentityInfo + + // Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled. + State *TopicSpacesConfigurationState +} + // UserIdentityProperties - The information about the user identity. type UserIdentityProperties struct { // The client id of user assigned identity. @@ -3203,6 +4955,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 @@ -3278,9 +5033,78 @@ type WebHookEventSubscriptionDestinationProperties struct { // Maximum number of events per batch. MaxEventsPerBatch *int32 + // Minimum TLS version that should be supported by webhook endpoint + MinimumTLSVersionAllowed *TLSVersion + // Preferred batch size in Kilobytes. PreferredBatchSizeInKilobytes *int32 // READ-ONLY; The base URL that represents the endpoint of the destination of an event subscription. 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, + ResourceGroupName: w.ResourceGroupName, + Name: w.Name, + EndpointType: w.EndpointType, + EndpointServiceContext: w.EndpointServiceContext, + 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 0a80130657a8..8359738815c0 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/models_serde.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/models_serde.go @@ -47,6 +47,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) @@ -152,6 +214,158 @@ func (b *BoolEqualsAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BoolEqualsFilter. +func (b BoolEqualsFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", b.Key) + objectMap["operatorType"] = FilterOperatorTypeBoolEquals + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BoolEqualsFilter. +func (b *BoolEqualsFilter) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &b.Key) + delete(rawMsg, key) + case "operatorType": + err = unpopulate(val, "OperatorType", &b.OperatorType) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CaCertificate. +func (c CaCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CaCertificate. +func (c *CaCertificate) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 CaCertificateProperties. +func (c CaCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + populate(objectMap, "encodedCertificate", c.EncodedCertificate) + populateTimeRFC3339(objectMap, "expiryTimeInUtc", c.ExpiryTimeInUTC) + populateTimeRFC3339(objectMap, "issueTimeInUtc", c.IssueTimeInUTC) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CaCertificateProperties. +func (c *CaCertificateProperties) 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 "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "encodedCertificate": + err = unpopulate(val, "EncodedCertificate", &c.EncodedCertificate) + delete(rawMsg, key) + case "expiryTimeInUtc": + err = unpopulateTimeRFC3339(val, "ExpiryTimeInUTC", &c.ExpiryTimeInUTC) + delete(rawMsg, key) + case "issueTimeInUtc": + err = unpopulateTimeRFC3339(val, "IssueTimeInUTC", &c.IssueTimeInUTC) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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 CaCertificatesListResult. +func (c CaCertificatesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CaCertificatesListResult. +func (c *CaCertificatesListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 Channel. func (c Channel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -201,6 +415,7 @@ func (c ChannelProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "channelType", c.ChannelType) populateTimeRFC3339(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) @@ -225,6 +440,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) @@ -273,6 +491,7 @@ func (c *ChannelUpdateParameters) UnmarshalJSON(data []byte) error { func (c ChannelUpdateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", c.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "partnerDestinationInfo", c.PartnerDestinationInfo) populate(objectMap, "partnerTopicInfo", c.PartnerTopicInfo) return json.Marshal(objectMap) } @@ -289,6 +508,9 @@ func (c *ChannelUpdateParametersProperties) UnmarshalJSON(data []byte) error { case "expirationTimeIfNotActivatedUtc": err = unpopulateTimeRFC3339(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) @@ -331,17 +553,19 @@ func (c *ChannelsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionState. -func (c ConnectionState) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Client. +func (c Client) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", c.ActionsRequired) - populate(objectMap, "description", c.Description) - populate(objectMap, "status", c.Status) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionState. -func (c *ConnectionState) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Client. +func (c *Client) 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) @@ -349,14 +573,20 @@ func (c *ConnectionState) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &c.ActionsRequired) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -366,417 +596,400 @@ func (c *ConnectionState) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeadLetterDestination. -func (d DeadLetterDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientAuthentication. +func (c ClientAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = d.EndpointType + populate(objectMap, "certificateSubject", c.CertificateSubject) + populate(objectMap, "certificateThumbprint", c.CertificateThumbprint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeadLetterDestination. -func (d *DeadLetterDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientAuthentication. +func (c *ClientAuthentication) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "endpointType": - err = unpopulate(val, "EndpointType", &d.EndpointType) + case "certificateSubject": + err = unpopulate(val, "CertificateSubject", &c.CertificateSubject) + delete(rawMsg, key) + case "certificateThumbprint": + err = unpopulate(val, "CertificateThumbprint", &c.CertificateThumbprint) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeadLetterWithResourceIdentity. -func (d DeadLetterWithResourceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientAuthenticationSettings. +func (c ClientAuthenticationSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deadLetterDestination", d.DeadLetterDestination) - populate(objectMap, "identity", d.Identity) + populate(objectMap, "alternativeAuthenticationNameSources", c.AlternativeAuthenticationNameSources) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeadLetterWithResourceIdentity. -func (d *DeadLetterWithResourceIdentity) UnmarshalJSON(data []byte) error { +// 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "deadLetterDestination": - d.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &d.Identity) + case "alternativeAuthenticationNameSources": + err = unpopulate(val, "AlternativeAuthenticationNameSources", &c.AlternativeAuthenticationNameSources) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeliveryAttributeListResult. -func (d DeliveryAttributeListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientCertificateAuthentication. +func (c ClientCertificateAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) + populate(objectMap, "allowedThumbprints", c.AllowedThumbprints) + populate(objectMap, "validationScheme", c.ValidationScheme) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryAttributeListResult. -func (d *DeliveryAttributeListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientCertificateAuthentication. +func (c *ClientCertificateAuthentication) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "value": - d.Value, err = unmarshalDeliveryAttributeMappingClassificationArray(val) + case "allowedThumbprints": + err = unpopulate(val, "AllowedThumbprints", &c.AllowedThumbprints) + delete(rawMsg, key) + case "validationScheme": + err = unpopulate(val, "ValidationScheme", &c.ValidationScheme) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeliveryAttributeMapping. -func (d DeliveryAttributeMapping) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientCertificateSubjectDistinguishedName. +func (c ClientCertificateSubjectDistinguishedName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - objectMap["type"] = d.Type + populate(objectMap, "commonName", c.CommonName) + populate(objectMap, "countryCode", c.CountryCode) + populate(objectMap, "organization", c.Organization) + populate(objectMap, "organizationUnit", c.OrganizationUnit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryAttributeMapping. -func (d *DeliveryAttributeMapping) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientCertificateSubjectDistinguishedName. +func (c *ClientCertificateSubjectDistinguishedName) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) + case "commonName": + err = unpopulate(val, "CommonName", &c.CommonName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "countryCode": + err = unpopulate(val, "CountryCode", &c.CountryCode) + delete(rawMsg, key) + case "organization": + err = unpopulate(val, "Organization", &c.Organization) + delete(rawMsg, key) + case "organizationUnit": + err = unpopulate(val, "OrganizationUnit", &c.OrganizationUnit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeliveryWithResourceIdentity. -func (d DeliveryWithResourceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientCertificateThumbprint. +func (c ClientCertificateThumbprint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "destination", d.Destination) - populate(objectMap, "identity", d.Identity) + populate(objectMap, "primary", c.Primary) + populate(objectMap, "secondary", c.Secondary) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryWithResourceIdentity. -func (d *DeliveryWithResourceIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientCertificateThumbprint. +func (c *ClientCertificateThumbprint) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "destination": - d.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) + case "primary": + err = unpopulate(val, "Primary", &c.Primary) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &d.Identity) + case "secondary": + err = unpopulate(val, "Secondary", &c.Secondary) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Domain. -func (d Domain) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientGroup. +func (c ClientGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Domain. -func (d *Domain) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientGroup. +func (c *ClientGroup) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &d.Name) + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &d.Properties) + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainProperties. -func (d DomainProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientGroupProperties. +func (c ClientGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) - populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) - populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "endpoint", d.Endpoint) - populate(objectMap, "inboundIpRules", d.InboundIPRules) - populate(objectMap, "inputSchema", d.InputSchema) - populate(objectMap, "inputSchemaMapping", d.InputSchemaMapping) - populate(objectMap, "metricResourceId", d.MetricResourceID) - populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) + populate(objectMap, "description", c.Description) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "query", c.Query) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainProperties. -func (d *DomainProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientGroupProperties. +func (c *ClientGroupProperties) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "autoCreateTopicWithFirstSubscription": - err = unpopulate(val, "AutoCreateTopicWithFirstSubscription", &d.AutoCreateTopicWithFirstSubscription) - delete(rawMsg, key) - case "autoDeleteTopicWithLastSubscription": - err = unpopulate(val, "AutoDeleteTopicWithLastSubscription", &d.AutoDeleteTopicWithLastSubscription) - delete(rawMsg, key) - case "dataResidencyBoundary": - err = unpopulate(val, "DataResidencyBoundary", &d.DataResidencyBoundary) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) - delete(rawMsg, key) - case "endpoint": - err = unpopulate(val, "Endpoint", &d.Endpoint) - delete(rawMsg, key) - case "inboundIpRules": - err = unpopulate(val, "InboundIPRules", &d.InboundIPRules) - delete(rawMsg, key) - case "inputSchema": - err = unpopulate(val, "InputSchema", &d.InputSchema) - delete(rawMsg, key) - case "inputSchemaMapping": - d.InputSchemaMapping, err = unmarshalInputSchemaMappingClassification(val) - delete(rawMsg, key) - case "metricResourceId": - err = unpopulate(val, "MetricResourceID", &d.MetricResourceID) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) + case "query": + err = unpopulate(val, "Query", &c.Query) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainRegenerateKeyRequest. -func (d DomainRegenerateKeyRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientGroupsListResult. +func (c ClientGroupsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keyName", d.KeyName) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainRegenerateKeyRequest. -func (d *DomainRegenerateKeyRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientGroupsListResult. +func (c *ClientGroupsListResult) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "keyName": - err = unpopulate(val, "KeyName", &d.KeyName) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainSharedAccessKeys. -func (d DomainSharedAccessKeys) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientProperties. +func (c ClientProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key1", d.Key1) - populate(objectMap, "key2", d.Key2) + populate(objectMap, "attributes", c.Attributes) + populate(objectMap, "authentication", c.Authentication) + populate(objectMap, "authenticationName", c.AuthenticationName) + populate(objectMap, "clientCertificateAuthentication", c.ClientCertificateAuthentication) + populate(objectMap, "description", c.Description) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "state", c.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainSharedAccessKeys. -func (d *DomainSharedAccessKeys) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientProperties. +func (c *ClientProperties) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "key1": - err = unpopulate(val, "Key1", &d.Key1) + case "attributes": + err = unpopulate(val, "Attributes", &c.Attributes) delete(rawMsg, key) - case "key2": - err = unpopulate(val, "Key2", &d.Key2) + case "authentication": + err = unpopulate(val, "Authentication", &c.Authentication) + delete(rawMsg, key) + case "authenticationName": + err = unpopulate(val, "AuthenticationName", &c.AuthenticationName) + delete(rawMsg, key) + case "clientCertificateAuthentication": + err = unpopulate(val, "ClientCertificateAuthentication", &c.ClientCertificateAuthentication) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainTopic. -func (d DomainTopic) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientsListResult. +func (c ClientsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopic. -func (d *DomainTopic) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientsListResult. +func (c *ClientsListResult) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainTopicProperties. -func (d DomainTopicProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectionState. +func (c ConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "actionsRequired", c.ActionsRequired) + populate(objectMap, "description", c.Description) + populate(objectMap, "status", c.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopicProperties. -func (d *DomainTopicProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionState. +func (c *ConnectionState) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &c.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainTopicsListResult. -func (d DomainTopicsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeadLetterDestination. +func (d DeadLetterDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + objectMap["endpointType"] = d.EndpointType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopicsListResult. -func (d *DomainTopicsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeadLetterDestination. +func (d *DeadLetterDestination) 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", d, err) @@ -784,11 +997,8 @@ func (d *DomainTopicsListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "endpointType": + err = unpopulate(val, "EndpointType", &d.EndpointType) delete(rawMsg, key) } if err != nil { @@ -798,20 +1008,16 @@ func (d *DomainTopicsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainUpdateParameterProperties. -func (d DomainUpdateParameterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeadLetterWithResourceIdentity. +func (d DeadLetterWithResourceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) - populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) - populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "inboundIpRules", d.InboundIPRules) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) + populate(objectMap, "deadLetterDestination", d.DeadLetterDestination) + populate(objectMap, "identity", d.Identity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainUpdateParameterProperties. -func (d *DomainUpdateParameterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeadLetterWithResourceIdentity. +func (d *DeadLetterWithResourceIdentity) 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", d, err) @@ -819,23 +1025,11 @@ func (d *DomainUpdateParameterProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "autoCreateTopicWithFirstSubscription": - err = unpopulate(val, "AutoCreateTopicWithFirstSubscription", &d.AutoCreateTopicWithFirstSubscription) + case "deadLetterDestination": + d.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) delete(rawMsg, key) - case "autoDeleteTopicWithLastSubscription": - err = unpopulate(val, "AutoDeleteTopicWithLastSubscription", &d.AutoDeleteTopicWithLastSubscription) - delete(rawMsg, key) - case "dataResidencyBoundary": - err = unpopulate(val, "DataResidencyBoundary", &d.DataResidencyBoundary) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) - delete(rawMsg, key) - case "inboundIpRules": - err = unpopulate(val, "InboundIPRules", &d.InboundIPRules) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) } if err != nil { @@ -845,17 +1039,15 @@ func (d *DomainUpdateParameterProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainUpdateParameters. -func (d DomainUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeliveryAttributeListResult. +func (d DeliveryAttributeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainUpdateParameters. -func (d *DomainUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryAttributeListResult. +func (d *DeliveryAttributeListResult) 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", d, err) @@ -863,14 +1055,8 @@ func (d *DomainUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "value": + d.Value, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) } if err != nil { @@ -880,16 +1066,16 @@ func (d *DomainUpdateParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DomainsListResult. -func (d DomainsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeliveryAttributeMapping. +func (d DeliveryAttributeMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "name", d.Name) + objectMap["type"] = d.Type return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DomainsListResult. -func (d *DomainsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryAttributeMapping. +func (d *DeliveryAttributeMapping) 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", d, err) @@ -897,11 +1083,11 @@ func (d *DomainsListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { @@ -911,17 +1097,16 @@ func (d *DomainsListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DynamicDeliveryAttributeMapping. -func (d DynamicDeliveryAttributeMapping) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeliveryConfiguration. +func (d DeliveryConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - objectMap["type"] = DeliveryAttributeMappingTypeDynamic + populate(objectMap, "deliveryMode", d.DeliveryMode) + populate(objectMap, "queue", d.Queue) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicDeliveryAttributeMapping. -func (d *DynamicDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryConfiguration. +func (d *DeliveryConfiguration) 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", d, err) @@ -929,14 +1114,11 @@ func (d *DynamicDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "deliveryMode": + err = unpopulate(val, "DeliveryMode", &d.DeliveryMode) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "queue": + err = unpopulate(val, "Queue", &d.Queue) delete(rawMsg, key) } if err != nil { @@ -946,15 +1128,16 @@ func (d *DynamicDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DynamicDeliveryAttributeMappingProperties. -func (d DynamicDeliveryAttributeMappingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeliveryWithResourceIdentity. +func (d DeliveryWithResourceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sourceField", d.SourceField) + populate(objectMap, "destination", d.Destination) + populate(objectMap, "identity", d.Identity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicDeliveryAttributeMappingProperties. -func (d *DynamicDeliveryAttributeMappingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryWithResourceIdentity. +func (d *DeliveryWithResourceIdentity) 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", d, err) @@ -962,8 +1145,11 @@ func (d *DynamicDeliveryAttributeMappingProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "sourceField": - err = unpopulate(val, "SourceField", &d.SourceField) + case "destination": + d.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) } if err != nil { @@ -973,1406 +1159,4118 @@ func (d *DynamicDeliveryAttributeMappingProperties) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type EventHubEventSubscriptionDestination. -func (e EventHubEventSubscriptionDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Domain. +func (d Domain) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = EndpointTypeEventHub - populate(objectMap, "properties", e.Properties) + populate(objectMap, "id", d.ID) + populate(objectMap, "identity", d.Identity) + 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) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubEventSubscriptionDestination. -func (e *EventHubEventSubscriptionDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Domain. +func (d *Domain) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "endpointType": - err = unpopulate(val, "EndpointType", &e.EndpointType) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.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) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventHubEventSubscriptionDestinationProperties. -func (e EventHubEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainProperties. +func (d DomainProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deliveryAttributeMappings", e.DeliveryAttributeMappings) - populate(objectMap, "resourceId", e.ResourceID) + populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) + populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) + populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "endpoint", d.Endpoint) + populate(objectMap, "eventTypeInfo", d.EventTypeInfo) + populate(objectMap, "inboundIpRules", d.InboundIPRules) + populate(objectMap, "inputSchema", d.InputSchema) + populate(objectMap, "inputSchemaMapping", d.InputSchemaMapping) + populate(objectMap, "metricResourceId", d.MetricResourceID) + populate(objectMap, "minimumTlsVersionAllowed", d.MinimumTLSVersionAllowed) + populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubEventSubscriptionDestinationProperties. -func (e *EventHubEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainProperties. +func (d *DomainProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "deliveryAttributeMappings": - e.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) + case "autoCreateTopicWithFirstSubscription": + err = unpopulate(val, "AutoCreateTopicWithFirstSubscription", &d.AutoCreateTopicWithFirstSubscription) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &e.ResourceID) + case "autoDeleteTopicWithLastSubscription": + err = unpopulate(val, "AutoDeleteTopicWithLastSubscription", &d.AutoDeleteTopicWithLastSubscription) + delete(rawMsg, key) + case "dataResidencyBoundary": + err = unpopulate(val, "DataResidencyBoundary", &d.DataResidencyBoundary) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &d.Endpoint) + delete(rawMsg, key) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &d.EventTypeInfo) + delete(rawMsg, key) + case "inboundIpRules": + err = unpopulate(val, "InboundIPRules", &d.InboundIPRules) + delete(rawMsg, key) + case "inputSchema": + err = unpopulate(val, "InputSchema", &d.InputSchema) + delete(rawMsg, key) + case "inputSchemaMapping": + d.InputSchemaMapping, err = unmarshalInputSchemaMappingClassification(val) + delete(rawMsg, key) + case "metricResourceId": + err = unpopulate(val, "MetricResourceID", &d.MetricResourceID) + delete(rawMsg, key) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &d.MinimumTLSVersionAllowed) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscription. -func (e EventSubscription) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainRegenerateKeyRequest. +func (d DomainRegenerateKeyRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) + populate(objectMap, "keyName", d.KeyName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscription. -func (e *EventSubscription) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainRegenerateKeyRequest. +func (d *DomainRegenerateKeyRequest) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "keyName": + err = unpopulate(val, "KeyName", &d.KeyName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscriptionDestination. -func (e EventSubscriptionDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainSharedAccessKeys. +func (d DomainSharedAccessKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = e.EndpointType + populate(objectMap, "key1", d.Key1) + populate(objectMap, "key2", d.Key2) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionDestination. -func (e *EventSubscriptionDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainSharedAccessKeys. +func (d *DomainSharedAccessKeys) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "endpointType": - err = unpopulate(val, "EndpointType", &e.EndpointType) + case "key1": + err = unpopulate(val, "Key1", &d.Key1) + delete(rawMsg, key) + case "key2": + err = unpopulate(val, "Key2", &d.Key2) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscriptionFilter. -func (e EventSubscriptionFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainTopic. +func (d DomainTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "advancedFilters", e.AdvancedFilters) - populate(objectMap, "enableAdvancedFilteringOnArrays", e.EnableAdvancedFilteringOnArrays) - populate(objectMap, "includedEventTypes", e.IncludedEventTypes) - populate(objectMap, "isSubjectCaseSensitive", e.IsSubjectCaseSensitive) - populate(objectMap, "subjectBeginsWith", e.SubjectBeginsWith) - populate(objectMap, "subjectEndsWith", e.SubjectEndsWith) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionFilter. -func (e *EventSubscriptionFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopic. +func (d *DomainTopic) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "advancedFilters": - e.AdvancedFilters, err = unmarshalAdvancedFilterClassificationArray(val) - delete(rawMsg, key) - case "enableAdvancedFilteringOnArrays": - err = unpopulate(val, "EnableAdvancedFilteringOnArrays", &e.EnableAdvancedFilteringOnArrays) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "includedEventTypes": - err = unpopulate(val, "IncludedEventTypes", &e.IncludedEventTypes) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "isSubjectCaseSensitive": - err = unpopulate(val, "IsSubjectCaseSensitive", &e.IsSubjectCaseSensitive) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "subjectBeginsWith": - err = unpopulate(val, "SubjectBeginsWith", &e.SubjectBeginsWith) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "subjectEndsWith": - err = unpopulate(val, "SubjectEndsWith", &e.SubjectEndsWith) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscriptionFullURL. -func (e EventSubscriptionFullURL) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainTopicProperties. +func (d DomainTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endpointUrl", e.EndpointURL) + populate(objectMap, "provisioningState", d.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionFullURL. -func (e *EventSubscriptionFullURL) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopicProperties. +func (d *DomainTopicProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "endpointUrl": - err = unpopulate(val, "EndpointURL", &e.EndpointURL) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscriptionIdentity. -func (e EventSubscriptionIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainTopicsListResult. +func (d DomainTopicsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", e.Type) - populate(objectMap, "userAssignedIdentity", e.UserAssignedIdentity) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionIdentity. -func (e *EventSubscriptionIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopicsListResult. +func (d *DomainTopicsListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &e.Type) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "userAssignedIdentity": - err = unpopulate(val, "UserAssignedIdentity", &e.UserAssignedIdentity) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscriptionProperties. -func (e EventSubscriptionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainUpdateParameterProperties. +func (d DomainUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deadLetterDestination", e.DeadLetterDestination) - populate(objectMap, "deadLetterWithResourceIdentity", e.DeadLetterWithResourceIdentity) - populate(objectMap, "deliveryWithResourceIdentity", e.DeliveryWithResourceIdentity) - populate(objectMap, "destination", e.Destination) - populate(objectMap, "eventDeliverySchema", e.EventDeliverySchema) - populateTimeRFC3339(objectMap, "expirationTimeUtc", e.ExpirationTimeUTC) - populate(objectMap, "filter", e.Filter) - populate(objectMap, "labels", e.Labels) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "retryPolicy", e.RetryPolicy) - populate(objectMap, "topic", e.Topic) + populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) + populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) + populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "eventTypeInfo", d.EventTypeInfo) + populate(objectMap, "inboundIpRules", d.InboundIPRules) + populate(objectMap, "minimumTlsVersionAllowed", d.MinimumTLSVersionAllowed) + populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionProperties. -func (e *EventSubscriptionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainUpdateParameterProperties. +func (d *DomainUpdateParameterProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "deadLetterDestination": - e.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) - delete(rawMsg, key) - case "deadLetterWithResourceIdentity": - err = unpopulate(val, "DeadLetterWithResourceIdentity", &e.DeadLetterWithResourceIdentity) - delete(rawMsg, key) - case "deliveryWithResourceIdentity": - err = unpopulate(val, "DeliveryWithResourceIdentity", &e.DeliveryWithResourceIdentity) - delete(rawMsg, key) - case "destination": - e.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) + case "autoCreateTopicWithFirstSubscription": + err = unpopulate(val, "AutoCreateTopicWithFirstSubscription", &d.AutoCreateTopicWithFirstSubscription) delete(rawMsg, key) - case "eventDeliverySchema": - err = unpopulate(val, "EventDeliverySchema", &e.EventDeliverySchema) + case "autoDeleteTopicWithLastSubscription": + err = unpopulate(val, "AutoDeleteTopicWithLastSubscription", &d.AutoDeleteTopicWithLastSubscription) delete(rawMsg, key) - case "expirationTimeUtc": - err = unpopulateTimeRFC3339(val, "ExpirationTimeUTC", &e.ExpirationTimeUTC) + case "dataResidencyBoundary": + err = unpopulate(val, "DataResidencyBoundary", &d.DataResidencyBoundary) delete(rawMsg, key) - case "filter": - err = unpopulate(val, "Filter", &e.Filter) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &e.Labels) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &d.EventTypeInfo) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + case "inboundIpRules": + err = unpopulate(val, "InboundIPRules", &d.InboundIPRules) delete(rawMsg, key) - case "retryPolicy": - err = unpopulate(val, "RetryPolicy", &e.RetryPolicy) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &d.MinimumTLSVersionAllowed) delete(rawMsg, key) - case "topic": - err = unpopulate(val, "Topic", &e.Topic) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscriptionUpdateParameters. -func (e EventSubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainUpdateParameters. +func (d DomainUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deadLetterDestination", e.DeadLetterDestination) - populate(objectMap, "deadLetterWithResourceIdentity", e.DeadLetterWithResourceIdentity) - populate(objectMap, "deliveryWithResourceIdentity", e.DeliveryWithResourceIdentity) - populate(objectMap, "destination", e.Destination) - populate(objectMap, "eventDeliverySchema", e.EventDeliverySchema) - populateTimeRFC3339(objectMap, "expirationTimeUtc", e.ExpirationTimeUTC) - populate(objectMap, "filter", e.Filter) - populate(objectMap, "labels", e.Labels) - populate(objectMap, "retryPolicy", e.RetryPolicy) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionUpdateParameters. -func (e *EventSubscriptionUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainUpdateParameters. +func (d *DomainUpdateParameters) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "deadLetterDestination": - e.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) - delete(rawMsg, key) - case "deadLetterWithResourceIdentity": - err = unpopulate(val, "DeadLetterWithResourceIdentity", &e.DeadLetterWithResourceIdentity) - delete(rawMsg, key) - case "deliveryWithResourceIdentity": - err = unpopulate(val, "DeliveryWithResourceIdentity", &e.DeliveryWithResourceIdentity) - delete(rawMsg, key) - case "destination": - e.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) - delete(rawMsg, key) - case "eventDeliverySchema": - err = unpopulate(val, "EventDeliverySchema", &e.EventDeliverySchema) - delete(rawMsg, key) - case "expirationTimeUtc": - err = unpopulateTimeRFC3339(val, "ExpirationTimeUTC", &e.ExpirationTimeUTC) + case "identity": + err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) - case "filter": - err = unpopulate(val, "Filter", &e.Filter) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &e.Labels) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) delete(rawMsg, key) - case "retryPolicy": - err = unpopulate(val, "RetryPolicy", &e.RetryPolicy) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventSubscriptionsListResult. -func (e EventSubscriptionsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DomainsListResult. +func (d DomainsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionsListResult. -func (e *EventSubscriptionsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainsListResult. +func (d *DomainsListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &e.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventType. -func (e EventType) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DynamicDeliveryAttributeMapping. +func (d DynamicDeliveryAttributeMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + objectMap["type"] = DeliveryAttributeMappingTypeDynamic return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventType. -func (e *EventType) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicDeliveryAttributeMapping. +func (d *DynamicDeliveryAttributeMapping) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DynamicDeliveryAttributeMappingProperties. +func (d DynamicDeliveryAttributeMappingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceField", d.SourceField) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicDeliveryAttributeMappingProperties. +func (d *DynamicDeliveryAttributeMappingProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceField": + err = unpopulate(val, "SourceField", &d.SourceField) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DynamicRoutingEnrichment. +func (d DynamicRoutingEnrichment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", d.Key) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicRoutingEnrichment. +func (d *DynamicRoutingEnrichment) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &d.Key) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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 "error": + err = unpopulate(val, "Error", &e.Error) + 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 EventHubEventSubscriptionDestination. +func (e EventHubEventSubscriptionDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["endpointType"] = EndpointTypeEventHub + populate(objectMap, "properties", e.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubEventSubscriptionDestination. +func (e *EventHubEventSubscriptionDestination) 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 "endpointType": + err = unpopulate(val, "EndpointType", &e.EndpointType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 EventHubEventSubscriptionDestinationProperties. +func (e EventHubEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deliveryAttributeMappings", e.DeliveryAttributeMappings) + populate(objectMap, "resourceId", e.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubEventSubscriptionDestinationProperties. +func (e *EventHubEventSubscriptionDestinationProperties) 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 "deliveryAttributeMappings": + e.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &e.ResourceID) + 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 EventSubscription. +func (e EventSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscription. +func (e *EventSubscription) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + 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 EventSubscriptionDestination. +func (e EventSubscriptionDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["endpointType"] = e.EndpointType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionDestination. +func (e *EventSubscriptionDestination) 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 "endpointType": + err = unpopulate(val, "EndpointType", &e.EndpointType) + 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 EventSubscriptionFilter. +func (e EventSubscriptionFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "advancedFilters", e.AdvancedFilters) + populate(objectMap, "enableAdvancedFilteringOnArrays", e.EnableAdvancedFilteringOnArrays) + populate(objectMap, "includedEventTypes", e.IncludedEventTypes) + populate(objectMap, "isSubjectCaseSensitive", e.IsSubjectCaseSensitive) + populate(objectMap, "subjectBeginsWith", e.SubjectBeginsWith) + populate(objectMap, "subjectEndsWith", e.SubjectEndsWith) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionFilter. +func (e *EventSubscriptionFilter) 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 "advancedFilters": + e.AdvancedFilters, err = unmarshalAdvancedFilterClassificationArray(val) + delete(rawMsg, key) + case "enableAdvancedFilteringOnArrays": + err = unpopulate(val, "EnableAdvancedFilteringOnArrays", &e.EnableAdvancedFilteringOnArrays) + delete(rawMsg, key) + case "includedEventTypes": + err = unpopulate(val, "IncludedEventTypes", &e.IncludedEventTypes) + delete(rawMsg, key) + case "isSubjectCaseSensitive": + err = unpopulate(val, "IsSubjectCaseSensitive", &e.IsSubjectCaseSensitive) + delete(rawMsg, key) + case "subjectBeginsWith": + err = unpopulate(val, "SubjectBeginsWith", &e.SubjectBeginsWith) + delete(rawMsg, key) + case "subjectEndsWith": + err = unpopulate(val, "SubjectEndsWith", &e.SubjectEndsWith) + 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 EventSubscriptionFullURL. +func (e EventSubscriptionFullURL) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpointUrl", e.EndpointURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionFullURL. +func (e *EventSubscriptionFullURL) 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 "endpointUrl": + err = unpopulate(val, "EndpointURL", &e.EndpointURL) + 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 EventSubscriptionIdentity. +func (e EventSubscriptionIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", e.Type) + populate(objectMap, "userAssignedIdentity", e.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionIdentity. +func (e *EventSubscriptionIdentity) 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 "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &e.UserAssignedIdentity) + 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 EventSubscriptionProperties. +func (e EventSubscriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deadLetterDestination", e.DeadLetterDestination) + populate(objectMap, "deadLetterWithResourceIdentity", e.DeadLetterWithResourceIdentity) + populate(objectMap, "deliveryWithResourceIdentity", e.DeliveryWithResourceIdentity) + populate(objectMap, "destination", e.Destination) + populate(objectMap, "eventDeliverySchema", e.EventDeliverySchema) + populateTimeRFC3339(objectMap, "expirationTimeUtc", e.ExpirationTimeUTC) + populate(objectMap, "filter", e.Filter) + populate(objectMap, "labels", e.Labels) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "retryPolicy", e.RetryPolicy) + populate(objectMap, "topic", e.Topic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionProperties. +func (e *EventSubscriptionProperties) 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 "deadLetterDestination": + e.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) + delete(rawMsg, key) + case "deadLetterWithResourceIdentity": + err = unpopulate(val, "DeadLetterWithResourceIdentity", &e.DeadLetterWithResourceIdentity) + delete(rawMsg, key) + case "deliveryWithResourceIdentity": + err = unpopulate(val, "DeliveryWithResourceIdentity", &e.DeliveryWithResourceIdentity) + delete(rawMsg, key) + case "destination": + e.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) + delete(rawMsg, key) + case "eventDeliverySchema": + err = unpopulate(val, "EventDeliverySchema", &e.EventDeliverySchema) + delete(rawMsg, key) + case "expirationTimeUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeUTC", &e.ExpirationTimeUTC) + delete(rawMsg, key) + case "filter": + err = unpopulate(val, "Filter", &e.Filter) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &e.Labels) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "retryPolicy": + err = unpopulate(val, "RetryPolicy", &e.RetryPolicy) + delete(rawMsg, key) + case "topic": + err = unpopulate(val, "Topic", &e.Topic) + 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 EventSubscriptionUpdateParameters. +func (e EventSubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deadLetterDestination", e.DeadLetterDestination) + populate(objectMap, "deadLetterWithResourceIdentity", e.DeadLetterWithResourceIdentity) + populate(objectMap, "deliveryWithResourceIdentity", e.DeliveryWithResourceIdentity) + populate(objectMap, "destination", e.Destination) + populate(objectMap, "eventDeliverySchema", e.EventDeliverySchema) + populateTimeRFC3339(objectMap, "expirationTimeUtc", e.ExpirationTimeUTC) + populate(objectMap, "filter", e.Filter) + populate(objectMap, "labels", e.Labels) + populate(objectMap, "retryPolicy", e.RetryPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionUpdateParameters. +func (e *EventSubscriptionUpdateParameters) 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 "deadLetterDestination": + e.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) + delete(rawMsg, key) + case "deadLetterWithResourceIdentity": + err = unpopulate(val, "DeadLetterWithResourceIdentity", &e.DeadLetterWithResourceIdentity) + delete(rawMsg, key) + case "deliveryWithResourceIdentity": + err = unpopulate(val, "DeliveryWithResourceIdentity", &e.DeliveryWithResourceIdentity) + delete(rawMsg, key) + case "destination": + e.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) + delete(rawMsg, key) + case "eventDeliverySchema": + err = unpopulate(val, "EventDeliverySchema", &e.EventDeliverySchema) + delete(rawMsg, key) + case "expirationTimeUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeUTC", &e.ExpirationTimeUTC) + delete(rawMsg, key) + case "filter": + err = unpopulate(val, "Filter", &e.Filter) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &e.Labels) + delete(rawMsg, key) + case "retryPolicy": + err = unpopulate(val, "RetryPolicy", &e.RetryPolicy) + 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 EventSubscriptionsListResult. +func (e EventSubscriptionsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionsListResult. +func (e *EventSubscriptionsListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 EventType. +func (e EventType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventType. +func (e *EventType) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 EventTypeInfo. +func (e EventTypeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inlineEventTypes", e.InlineEventTypes) + populate(objectMap, "kind", e.Kind) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventTypeInfo. +func (e *EventTypeInfo) 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 "inlineEventTypes": + err = unpopulate(val, "InlineEventTypes", &e.InlineEventTypes) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + 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 EventTypeProperties. +func (e EventTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", e.Description) + populate(objectMap, "displayName", e.DisplayName) + populate(objectMap, "isInDefaultSet", e.IsInDefaultSet) + populate(objectMap, "schemaUrl", e.SchemaURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventTypeProperties. +func (e *EventTypeProperties) 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 "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &e.DisplayName) + delete(rawMsg, key) + case "isInDefaultSet": + err = unpopulate(val, "IsInDefaultSet", &e.IsInDefaultSet) + delete(rawMsg, key) + case "schemaUrl": + err = unpopulate(val, "SchemaURL", &e.SchemaURL) + 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 EventTypesListResult. +func (e EventTypesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventTypesListResult. +func (e *EventTypesListResult) 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 "value": + err = unpopulate(val, "Value", &e.Value) + 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 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) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionTopic. +func (e *ExtensionTopic) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + 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 ExtensionTopicProperties. +func (e ExtensionTopicProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", e.Description) + populate(objectMap, "systemTopic", e.SystemTopic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionTopicProperties. +func (e *ExtensionTopicProperties) 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 "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "systemTopic": + err = unpopulate(val, "SystemTopic", &e.SystemTopic) + 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 Filter. +func (f Filter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", f.Key) + objectMap["operatorType"] = f.OperatorType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Filter. +func (f *Filter) 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 "key": + err = unpopulate(val, "Key", &f.Key) + delete(rawMsg, key) + case "operatorType": + err = unpopulate(val, "OperatorType", &f.OperatorType) + 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 FiltersConfiguration. +func (f FiltersConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "filters", f.Filters) + populate(objectMap, "includedEventTypes", f.IncludedEventTypes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FiltersConfiguration. +func (f *FiltersConfiguration) 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 "filters": + f.Filters, err = unmarshalFilterClassificationArray(val) + delete(rawMsg, key) + case "includedEventTypes": + err = unpopulate(val, "IncludedEventTypes", &f.IncludedEventTypes) + 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 HybridConnectionEventSubscriptionDestination. +func (h HybridConnectionEventSubscriptionDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["endpointType"] = EndpointTypeHybridConnection + populate(objectMap, "properties", h.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HybridConnectionEventSubscriptionDestination. +func (h *HybridConnectionEventSubscriptionDestination) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &h.EndpointType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HybridConnectionEventSubscriptionDestinationProperties. +func (h HybridConnectionEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deliveryAttributeMappings", h.DeliveryAttributeMappings) + populate(objectMap, "resourceId", h.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HybridConnectionEventSubscriptionDestinationProperties. +func (h *HybridConnectionEventSubscriptionDestinationProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deliveryAttributeMappings": + h.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &h.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityInfo. +func (i IdentityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityInfo. +func (i *IdentityInfo) 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 "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + 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 InboundIPRule. +func (i InboundIPRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", i.Action) + populate(objectMap, "ipMask", i.IPMask) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InboundIPRule. +func (i *InboundIPRule) 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 "action": + err = unpopulate(val, "Action", &i.Action) + delete(rawMsg, key) + case "ipMask": + err = unpopulate(val, "IPMask", &i.IPMask) + 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 InlineEventProperties. +func (i InlineEventProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataSchemaUrl", i.DataSchemaURL) + populate(objectMap, "description", i.Description) + populate(objectMap, "displayName", i.DisplayName) + populate(objectMap, "documentationUrl", i.DocumentationURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InlineEventProperties. +func (i *InlineEventProperties) 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 "dataSchemaUrl": + err = unpopulate(val, "DataSchemaURL", &i.DataSchemaURL) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &i.DisplayName) + delete(rawMsg, key) + case "documentationUrl": + err = unpopulate(val, "DocumentationURL", &i.DocumentationURL) + 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 InputSchemaMapping. +func (i InputSchemaMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["inputSchemaMappingType"] = i.InputSchemaMappingType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InputSchemaMapping. +func (i *InputSchemaMapping) 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 "inputSchemaMappingType": + err = unpopulate(val, "InputSchemaMappingType", &i.InputSchemaMappingType) + 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 IsNotNullAdvancedFilter. +func (i IsNotNullAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", i.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeIsNotNull + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IsNotNullAdvancedFilter. +func (i *IsNotNullAdvancedFilter) 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 "key": + err = unpopulate(val, "Key", &i.Key) + delete(rawMsg, key) + case "operatorType": + err = unpopulate(val, "OperatorType", &i.OperatorType) + 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 IsNotNullFilter. +func (i IsNotNullFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", i.Key) + objectMap["operatorType"] = FilterOperatorTypeIsNotNull + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IsNotNullFilter. +func (i *IsNotNullFilter) 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 "key": + err = unpopulate(val, "Key", &i.Key) + delete(rawMsg, key) + case "operatorType": + err = unpopulate(val, "OperatorType", &i.OperatorType) + 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 IsNullOrUndefinedAdvancedFilter. +func (i IsNullOrUndefinedAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", i.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeIsNullOrUndefined + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IsNullOrUndefinedAdvancedFilter. +func (i *IsNullOrUndefinedAdvancedFilter) 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 "key": + err = unpopulate(val, "Key", &i.Key) + delete(rawMsg, key) + case "operatorType": + err = unpopulate(val, "OperatorType", &i.OperatorType) + 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 IsNullOrUndefinedFilter. +func (i IsNullOrUndefinedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", i.Key) + objectMap["operatorType"] = FilterOperatorTypeIsNullOrUndefined + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IsNullOrUndefinedFilter. +func (i *IsNullOrUndefinedFilter) 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 "key": + err = unpopulate(val, "Key", &i.Key) + delete(rawMsg, key) + case "operatorType": + err = unpopulate(val, "OperatorType", &i.OperatorType) + 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) + populate(objectMap, "sourceField", j.SourceField) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JSONField. +func (j *JSONField) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceField": + err = unpopulate(val, "SourceField", &j.SourceField) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JSONFieldWithDefault. +func (j JSONFieldWithDefault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultValue", j.DefaultValue) + populate(objectMap, "sourceField", j.SourceField) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JSONFieldWithDefault. +func (j *JSONFieldWithDefault) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultValue": + err = unpopulate(val, "DefaultValue", &j.DefaultValue) + delete(rawMsg, key) + case "sourceField": + err = unpopulate(val, "SourceField", &j.SourceField) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JSONInputSchemaMapping. +func (j JSONInputSchemaMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["inputSchemaMappingType"] = InputSchemaMappingTypeJSON + populate(objectMap, "properties", j.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JSONInputSchemaMapping. +func (j *JSONInputSchemaMapping) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "inputSchemaMappingType": + err = unpopulate(val, "InputSchemaMappingType", &j.InputSchemaMappingType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JSONInputSchemaMappingProperties. +func (j JSONInputSchemaMappingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataVersion", j.DataVersion) + populate(objectMap, "eventTime", j.EventTime) + populate(objectMap, "eventType", j.EventType) + populate(objectMap, "id", j.ID) + populate(objectMap, "subject", j.Subject) + populate(objectMap, "topic", j.Topic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JSONInputSchemaMappingProperties. +func (j *JSONInputSchemaMappingProperties) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataVersion": + err = unpopulate(val, "DataVersion", &j.DataVersion) + delete(rawMsg, key) + case "eventTime": + err = unpopulate(val, "EventTime", &j.EventTime) + delete(rawMsg, key) + case "eventType": + err = unpopulate(val, "EventType", &j.EventType) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &j.Subject) + delete(rawMsg, key) + case "topic": + err = unpopulate(val, "Topic", &j.Topic) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Namespace. +func (n Namespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "identity", n.Identity) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "sku", n.SKU) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Namespace. +func (n *Namespace) 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 "identity": + err = unpopulate(val, "Identity", &n.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + 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 "sku": + err = unpopulate(val, "SKU", &n.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NamespaceProperties. +func (n NamespaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inboundIpRules", n.InboundIPRules) + populate(objectMap, "isZoneRedundant", n.IsZoneRedundant) + populate(objectMap, "minimumTlsVersionAllowed", n.MinimumTLSVersionAllowed) + populate(objectMap, "privateEndpointConnections", n.PrivateEndpointConnections) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + populate(objectMap, "topicSpacesConfiguration", n.TopicSpacesConfiguration) + populate(objectMap, "topicsConfiguration", n.TopicsConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceProperties. +func (n *NamespaceProperties) 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 "inboundIpRules": + err = unpopulate(val, "InboundIPRules", &n.InboundIPRules) + delete(rawMsg, key) + case "isZoneRedundant": + err = unpopulate(val, "IsZoneRedundant", &n.IsZoneRedundant) + delete(rawMsg, key) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &n.MinimumTLSVersionAllowed) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &n.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) + case "topicSpacesConfiguration": + err = unpopulate(val, "TopicSpacesConfiguration", &n.TopicSpacesConfiguration) + delete(rawMsg, key) + case "topicsConfiguration": + err = unpopulate(val, "TopicsConfiguration", &n.TopicsConfiguration) + 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 NamespaceRegenerateKeyRequest. +func (n NamespaceRegenerateKeyRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyName", n.KeyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceRegenerateKeyRequest. +func (n *NamespaceRegenerateKeyRequest) 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 "keyName": + err = unpopulate(val, "KeyName", &n.KeyName) + 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 NamespaceSKU. +func (n NamespaceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", n.Capacity) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceSKU. +func (n *NamespaceSKU) 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 "capacity": + err = unpopulate(val, "Capacity", &n.Capacity) + 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 NamespaceSharedAccessKeys. +func (n NamespaceSharedAccessKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key1", n.Key1) + populate(objectMap, "key2", n.Key2) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceSharedAccessKeys. +func (n *NamespaceSharedAccessKeys) 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 "key1": + err = unpopulate(val, "Key1", &n.Key1) + delete(rawMsg, key) + case "key2": + err = unpopulate(val, "Key2", &n.Key2) + 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 NamespaceTopic. +func (n NamespaceTopic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopic. +func (n *NamespaceTopic) 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 "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + 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 NamespaceTopicProperties. +func (n NamespaceTopicProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eventRetentionInDays", n.EventRetentionInDays) + populate(objectMap, "inputSchema", n.InputSchema) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publisherType", n.PublisherType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicProperties. +func (n *NamespaceTopicProperties) 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 "eventRetentionInDays": + err = unpopulate(val, "EventRetentionInDays", &n.EventRetentionInDays) + delete(rawMsg, key) + case "inputSchema": + err = unpopulate(val, "InputSchema", &n.InputSchema) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "publisherType": + err = unpopulate(val, "PublisherType", &n.PublisherType) + 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 NamespaceTopicUpdateParameterProperties. +func (n NamespaceTopicUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eventRetentionInDays", n.EventRetentionInDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicUpdateParameterProperties. +func (n *NamespaceTopicUpdateParameterProperties) 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 "eventRetentionInDays": + err = unpopulate(val, "EventRetentionInDays", &n.EventRetentionInDays) + 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 NamespaceTopicUpdateParameters. +func (n NamespaceTopicUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicUpdateParameters. +func (n *NamespaceTopicUpdateParameters) 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 "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 NamespaceTopicsListResult. +func (n NamespaceTopicsListResult) 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 NamespaceTopicsListResult. +func (n *NamespaceTopicsListResult) 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 NamespaceUpdateParameterProperties. +func (n NamespaceUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inboundIpRules", n.InboundIPRules) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + populate(objectMap, "topicSpacesConfiguration", n.TopicSpacesConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceUpdateParameterProperties. +func (n *NamespaceUpdateParameterProperties) 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 "inboundIpRules": + err = unpopulate(val, "InboundIPRules", &n.InboundIPRules) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) + case "topicSpacesConfiguration": + err = unpopulate(val, "TopicSpacesConfiguration", &n.TopicSpacesConfiguration) + 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 NamespaceUpdateParameters. +func (n NamespaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", n.Identity) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "sku", n.SKU) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceUpdateParameters. +func (n *NamespaceUpdateParameters) 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 "identity": + err = unpopulate(val, "Identity", &n.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &n.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NamespacesListResult. +func (n NamespacesListResult) 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 NamespacesListResult. +func (n *NamespacesListResult) 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 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberGreaterThanFilter. +func (n NumberGreaterThanFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberGreaterThan + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanFilter. +func (n *NumberGreaterThanFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberGreaterThanOrEqualsAdvancedFilter. +func (n NumberGreaterThanOrEqualsAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberGreaterThanOrEquals + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanOrEqualsAdvancedFilter. +func (n *NumberGreaterThanOrEqualsAdvancedFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberGreaterThanOrEqualsFilter. +func (n NumberGreaterThanOrEqualsFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberGreaterThanOrEquals + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanOrEqualsFilter. +func (n *NumberGreaterThanOrEqualsFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberInAdvancedFilter. +func (n NumberInAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberIn + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberInAdvancedFilter. +func (n *NumberInAdvancedFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 NumberInFilter. +func (n NumberInFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberIn + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberInFilter. +func (n *NumberInFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 NumberInRangeAdvancedFilter. +func (n NumberInRangeAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberInRange + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberInRangeAdvancedFilter. +func (n *NumberInRangeAdvancedFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 NumberInRangeFilter. +func (n NumberInRangeFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberInRange + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberInRangeFilter. +func (n *NumberInRangeFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 NumberLessThanAdvancedFilter. +func (n NumberLessThanAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberLessThan + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanAdvancedFilter. +func (n *NumberLessThanAdvancedFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberLessThanFilter. +func (n NumberLessThanFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberLessThan + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanFilter. +func (n *NumberLessThanFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberLessThanOrEqualsAdvancedFilter. +func (n NumberLessThanOrEqualsAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberLessThanOrEquals + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanOrEqualsAdvancedFilter. +func (n *NumberLessThanOrEqualsAdvancedFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberLessThanOrEqualsFilter. +func (n NumberLessThanOrEqualsFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberLessThanOrEquals + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanOrEqualsFilter. +func (n *NumberLessThanOrEqualsFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + 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 NumberNotInAdvancedFilter. +func (n NumberNotInAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberNotIn + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInAdvancedFilter. +func (n *NumberNotInAdvancedFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 NumberNotInFilter. +func (n NumberNotInFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberNotIn + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInFilter. +func (n *NumberNotInFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 NumberNotInRangeAdvancedFilter. +func (n NumberNotInRangeAdvancedFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberNotInRange + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInRangeAdvancedFilter. +func (n *NumberNotInRangeAdvancedFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 NumberNotInRangeFilter. +func (n NumberNotInRangeFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", n.Key) + objectMap["operatorType"] = FilterOperatorTypeNumberNotInRange + populate(objectMap, "values", n.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInRangeFilter. +func (n *NumberNotInRangeFilter) 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": + err = unpopulate(val, "OperatorType", &n.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &n.Values) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populateAny(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationInfo. +func (o OperationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationInfo. +func (o *OperationInfo) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsListResult. +func (o OperationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsListResult. +func (o *OperationsListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Partner. +func (p Partner) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "authorizationExpirationTimeInUtc", p.AuthorizationExpirationTimeInUTC) + populate(objectMap, "partnerName", p.PartnerName) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Partner. +func (p *Partner) 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 "authorizationExpirationTimeInUtc": + err = unpopulateTimeRFC3339(val, "AuthorizationExpirationTimeInUTC", &p.AuthorizationExpirationTimeInUTC) + delete(rawMsg, key) + case "partnerName": + err = unpopulate(val, "PartnerName", &p.PartnerName) + delete(rawMsg, key) + case "partnerRegistrationImmutableId": + err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) + 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 PartnerAuthorization. +func (p PartnerAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizedPartnersList", p.AuthorizedPartnersList) + populate(objectMap, "defaultMaximumExpirationTimeInDays", p.DefaultMaximumExpirationTimeInDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerAuthorization. +func (p *PartnerAuthorization) 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 "authorizedPartnersList": + err = unpopulate(val, "AuthorizedPartnersList", &p.AuthorizedPartnersList) + delete(rawMsg, key) + case "defaultMaximumExpirationTimeInDays": + err = unpopulate(val, "DefaultMaximumExpirationTimeInDays", &p.DefaultMaximumExpirationTimeInDays) + 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 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) + 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 PartnerConfiguration. +func (p *PartnerConfiguration) 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", &e.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", &e.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.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", &e.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventTypeInfo. -func (e EventTypeInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationProperties. +func (p PartnerConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "inlineEventTypes", e.InlineEventTypes) - populate(objectMap, "kind", e.Kind) + populate(objectMap, "partnerAuthorization", p.PartnerAuthorization) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventTypeInfo. -func (e *EventTypeInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationProperties. +func (p *PartnerConfigurationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "inlineEventTypes": - err = unpopulate(val, "InlineEventTypes", &e.InlineEventTypes) + case "partnerAuthorization": + err = unpopulate(val, "PartnerAuthorization", &p.PartnerAuthorization) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventTypeProperties. -func (e EventTypeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationUpdateParameterProperties. +func (p PartnerConfigurationUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", e.Description) - populate(objectMap, "displayName", e.DisplayName) - populate(objectMap, "isInDefaultSet", e.IsInDefaultSet) - populate(objectMap, "schemaUrl", e.SchemaURL) + populate(objectMap, "defaultMaximumExpirationTimeInDays", p.DefaultMaximumExpirationTimeInDays) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventTypeProperties. -func (e *EventTypeProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationUpdateParameterProperties. +func (p *PartnerConfigurationUpdateParameterProperties) 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) + 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", &e.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &e.DisplayName) - delete(rawMsg, key) - case "isInDefaultSet": - err = unpopulate(val, "IsInDefaultSet", &e.IsInDefaultSet) - delete(rawMsg, key) - case "schemaUrl": - err = unpopulate(val, "SchemaURL", &e.SchemaURL) + case "defaultMaximumExpirationTimeInDays": + err = unpopulate(val, "DefaultMaximumExpirationTimeInDays", &p.DefaultMaximumExpirationTimeInDays) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventTypesListResult. -func (e EventTypesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationUpdateParameters. +func (p PartnerConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", e.Value) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventTypesListResult. -func (e *EventTypesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationUpdateParameters. +func (p *PartnerConfigurationUpdateParameters) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &e.Value) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtensionTopic. -func (e ExtensionTopic) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationsListResult. +func (p PartnerConfigurationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionTopic. -func (e *ExtensionTopic) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationsListResult. +func (p *PartnerConfigurationsListResult) 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) + 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", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtensionTopicProperties. -func (e ExtensionTopicProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerDestination. +func (p PartnerDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", e.Description) - populate(objectMap, "systemTopic", e.SystemTopic) + 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 ExtensionTopicProperties. -func (e *ExtensionTopicProperties) UnmarshalJSON(data []byte) error { +// 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", e, err) + 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", &e.Description) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "systemTopic": - err = unpopulate(val, "SystemTopic", &e.SystemTopic) + 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HybridConnectionEventSubscriptionDestination. -func (h HybridConnectionEventSubscriptionDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationInfo. +func (p PartnerDestinationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = EndpointTypeHybridConnection - populate(objectMap, "properties", h.Properties) + 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 HybridConnectionEventSubscriptionDestination. -func (h *HybridConnectionEventSubscriptionDestination) UnmarshalJSON(data []byte) error { +// 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", h, err) + 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", &h.EndpointType) + err = unpopulate(val, "EndpointType", &p.EndpointType) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) + 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HybridConnectionEventSubscriptionDestinationProperties. -func (h HybridConnectionEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationProperties. +func (p PartnerDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deliveryAttributeMappings", h.DeliveryAttributeMappings) - populate(objectMap, "resourceId", h.ResourceID) + populate(objectMap, "activationState", p.ActivationState) + populate(objectMap, "endpointBaseUrl", p.EndpointBaseURL) + populate(objectMap, "endpointServiceContext", p.EndpointServiceContext) + populateTimeRFC3339(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 HybridConnectionEventSubscriptionDestinationProperties. -func (h *HybridConnectionEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { +// 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "deliveryAttributeMappings": - h.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) + case "activationState": + err = unpopulate(val, "ActivationState", &p.ActivationState) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &h.ResourceID) + 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 = unpopulateTimeRFC3339(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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityInfo. -func (i IdentityInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationUpdateParameters. +func (p PartnerDestinationUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityInfo. -func (i *IdentityInfo) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &i.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &i.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InboundIPRule. -func (i InboundIPRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationsListResult. +func (p PartnerDestinationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", i.Action) - populate(objectMap, "ipMask", i.IPMask) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InboundIPRule. -func (i *InboundIPRule) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &i.Action) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "ipMask": - err = unpopulate(val, "IPMask", &i.IPMask) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InlineEventProperties. -func (i InlineEventProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerDetails. +func (p PartnerDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataSchemaUrl", i.DataSchemaURL) - populate(objectMap, "description", i.Description) - populate(objectMap, "displayName", i.DisplayName) - populate(objectMap, "documentationUrl", i.DocumentationURL) + 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 InlineEventProperties. -func (i *InlineEventProperties) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "dataSchemaUrl": - err = unpopulate(val, "DataSchemaURL", &i.DataSchemaURL) - delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &i.Description) + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &i.DisplayName) + case "longDescription": + err = unpopulate(val, "LongDescription", &p.LongDescription) delete(rawMsg, key) - case "documentationUrl": - err = unpopulate(val, "DocumentationURL", &i.DocumentationURL) + case "setupUri": + err = unpopulate(val, "SetupURI", &p.SetupURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InputSchemaMapping. -func (i InputSchemaMapping) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerEventSubscriptionDestination. +func (p PartnerEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["inputSchemaMappingType"] = i.InputSchemaMappingType + objectMap["endpointType"] = EndpointTypePartnerDestination + populate(objectMap, "properties", p.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InputSchemaMapping. -func (i *InputSchemaMapping) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "inputSchemaMappingType": - err = unpopulate(val, "InputSchemaMappingType", &i.InputSchemaMappingType) + 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 { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IsNotNullAdvancedFilter. -func (i IsNotNullAdvancedFilter) 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, "key", i.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeIsNotNull + populate(objectMap, "resourceId", p.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IsNotNullAdvancedFilter. -func (i *IsNotNullAdvancedFilter) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &i.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &i.OperatorType) + case "resourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IsNullOrUndefinedAdvancedFilter. -func (i IsNullOrUndefinedAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespace. +func (p PartnerNamespace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", i.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeIsNullOrUndefined + 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 IsNullOrUndefinedAdvancedFilter. -func (i *IsNullOrUndefinedAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespace. +func (p *PartnerNamespace) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &i.Key) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &i.OperatorType) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JSONField. -func (j JSONField) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceProperties. +func (p PartnerNamespaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sourceField", j.SourceField) + populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) + populate(objectMap, "endpoint", p.Endpoint) + populate(objectMap, "inboundIpRules", p.InboundIPRules) + populate(objectMap, "minimumTlsVersionAllowed", p.MinimumTLSVersionAllowed) + populate(objectMap, "partnerRegistrationFullyQualifiedId", p.PartnerRegistrationFullyQualifiedID) + populate(objectMap, "partnerTopicRoutingMode", p.PartnerTopicRoutingMode) + populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JSONField. -func (j *JSONField) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceProperties. +func (p *PartnerNamespaceProperties) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "sourceField": - err = unpopulate(val, "SourceField", &j.SourceField) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &p.DisableLocalAuth) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &p.Endpoint) + delete(rawMsg, key) + case "inboundIpRules": + err = unpopulate(val, "InboundIPRules", &p.InboundIPRules) + delete(rawMsg, key) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &p.MinimumTLSVersionAllowed) + delete(rawMsg, key) + case "partnerRegistrationFullyQualifiedId": + err = unpopulate(val, "PartnerRegistrationFullyQualifiedID", &p.PartnerRegistrationFullyQualifiedID) + delete(rawMsg, key) + case "partnerTopicRoutingMode": + err = unpopulate(val, "PartnerTopicRoutingMode", &p.PartnerTopicRoutingMode) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &p.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &p.PublicNetworkAccess) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JSONFieldWithDefault. -func (j JSONFieldWithDefault) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceRegenerateKeyRequest. +func (p PartnerNamespaceRegenerateKeyRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultValue", j.DefaultValue) - populate(objectMap, "sourceField", j.SourceField) + populate(objectMap, "keyName", p.KeyName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JSONFieldWithDefault. -func (j *JSONFieldWithDefault) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceRegenerateKeyRequest. +func (p *PartnerNamespaceRegenerateKeyRequest) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "defaultValue": - err = unpopulate(val, "DefaultValue", &j.DefaultValue) - delete(rawMsg, key) - case "sourceField": - err = unpopulate(val, "SourceField", &j.SourceField) + case "keyName": + err = unpopulate(val, "KeyName", &p.KeyName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JSONInputSchemaMapping. -func (j JSONInputSchemaMapping) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceSharedAccessKeys. +func (p PartnerNamespaceSharedAccessKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["inputSchemaMappingType"] = InputSchemaMappingTypeJSON - populate(objectMap, "properties", j.Properties) + populate(objectMap, "key1", p.Key1) + populate(objectMap, "key2", p.Key2) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JSONInputSchemaMapping. -func (j *JSONInputSchemaMapping) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceSharedAccessKeys. +func (p *PartnerNamespaceSharedAccessKeys) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "inputSchemaMappingType": - err = unpopulate(val, "InputSchemaMappingType", &j.InputSchemaMappingType) + case "key1": + err = unpopulate(val, "Key1", &p.Key1) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) + case "key2": + err = unpopulate(val, "Key2", &p.Key2) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JSONInputSchemaMappingProperties. -func (j JSONInputSchemaMappingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceUpdateParameterProperties. +func (p PartnerNamespaceUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataVersion", j.DataVersion) - populate(objectMap, "eventTime", j.EventTime) - populate(objectMap, "eventType", j.EventType) - populate(objectMap, "id", j.ID) - populate(objectMap, "subject", j.Subject) - populate(objectMap, "topic", j.Topic) + populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) + populate(objectMap, "inboundIpRules", p.InboundIPRules) + populate(objectMap, "minimumTlsVersionAllowed", p.MinimumTLSVersionAllowed) + populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JSONInputSchemaMappingProperties. -func (j *JSONInputSchemaMappingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceUpdateParameterProperties. +func (p *PartnerNamespaceUpdateParameterProperties) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "dataVersion": - err = unpopulate(val, "DataVersion", &j.DataVersion) - delete(rawMsg, key) - case "eventTime": - err = unpopulate(val, "EventTime", &j.EventTime) - delete(rawMsg, key) - case "eventType": - err = unpopulate(val, "EventType", &j.EventType) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &j.ID) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &p.DisableLocalAuth) delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &j.Subject) + case "inboundIpRules": + err = unpopulate(val, "InboundIPRules", &p.InboundIPRules) delete(rawMsg, key) - case "topic": - err = unpopulate(val, "Topic", &j.Topic) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &p.MinimumTLSVersionAllowed) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &p.PublicNetworkAccess) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } 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 PartnerNamespaceUpdateParameters. +func (p PartnerNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberGreaterThan - populate(objectMap, "value", n.Value) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) 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 PartnerNamespaceUpdateParameters. +func (p *PartnerNamespaceUpdateParameters) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberGreaterThanOrEqualsAdvancedFilter. -func (n NumberGreaterThanOrEqualsAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespacesListResult. +func (p PartnerNamespacesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberGreaterThanOrEquals - populate(objectMap, "value", n.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanOrEqualsAdvancedFilter. -func (n *NumberGreaterThanOrEqualsAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespacesListResult. +func (p *PartnerNamespacesListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &n.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberInAdvancedFilter. -func (n NumberInAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerRegistration. +func (p PartnerRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberIn - populate(objectMap, "values", n.Values) + 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 NumberInAdvancedFilter. -func (n *NumberInAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistration. +func (p *PartnerRegistration) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) + case "location": + err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &n.Values) + 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberInRangeAdvancedFilter. -func (n NumberInRangeAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationProperties. +func (p PartnerRegistrationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberInRange - populate(objectMap, "values", n.Values) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NumberInRangeAdvancedFilter. -func (n *NumberInRangeAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationProperties. +func (p *PartnerRegistrationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) + case "partnerRegistrationImmutableId": + err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &n.Values) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberLessThanAdvancedFilter. -func (n NumberLessThanAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationUpdateParameters. +func (p PartnerRegistrationUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberLessThan - populate(objectMap, "value", n.Value) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanAdvancedFilter. -func (n *NumberLessThanAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationUpdateParameters. +func (p *PartnerRegistrationUpdateParameters) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberLessThanOrEqualsAdvancedFilter. -func (n NumberLessThanOrEqualsAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationsListResult. +func (p PartnerRegistrationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberLessThanOrEquals - populate(objectMap, "value", n.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanOrEqualsAdvancedFilter. -func (n *NumberLessThanOrEqualsAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationsListResult. +func (p *PartnerRegistrationsListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &n.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberNotInAdvancedFilter. -func (n NumberNotInAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerTopic. +func (p PartnerTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberNotIn - populate(objectMap, "values", n.Values) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + 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 NumberNotInAdvancedFilter. -func (n *NumberNotInAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopic. +func (p *PartnerTopic) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &n.Values) + 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NumberNotInRangeAdvancedFilter. -func (n NumberNotInRangeAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerTopicInfo. +func (p PartnerTopicInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", n.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberNotInRange - populate(objectMap, "values", n.Values) + populate(objectMap, "azureSubscriptionId", p.AzureSubscriptionID) + populate(objectMap, "eventTypeInfo", p.EventTypeInfo) + populate(objectMap, "name", p.Name) + populate(objectMap, "resourceGroupName", p.ResourceGroupName) + populate(objectMap, "source", p.Source) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInRangeAdvancedFilter. -func (n *NumberNotInRangeAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicInfo. +func (p *PartnerTopicInfo) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &n.Key) + case "azureSubscriptionId": + err = unpopulate(val, "AzureSubscriptionID", &p.AzureSubscriptionID) delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &n.OperatorType) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &n.Values) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &p.ResourceGroupName) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &p.Source) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerTopicProperties. +func (p PartnerTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "isDataAction", o.IsDataAction) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populateAny(objectMap, "properties", o.Properties) + populate(objectMap, "activationState", p.ActivationState) + populate(objectMap, "eventTypeInfo", p.EventTypeInfo) + populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", p.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "messageForActivation", p.MessageForActivation) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + populate(objectMap, "partnerTopicFriendlyDescription", p.PartnerTopicFriendlyDescription) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "source", p.Source) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicProperties. +func (p *PartnerTopicProperties) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "activationState": + err = unpopulate(val, "ActivationState", &p.ActivationState) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "expirationTimeIfNotActivatedUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &p.ExpirationTimeIfNotActivatedUTC) delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + case "messageForActivation": + err = unpopulate(val, "MessageForActivation", &p.MessageForActivation) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "partnerRegistrationImmutableId": + err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) + delete(rawMsg, key) + case "partnerTopicFriendlyDescription": + err = unpopulate(val, "PartnerTopicFriendlyDescription", &p.PartnerTopicFriendlyDescription) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &p.Source) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationInfo. -func (o OperationInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerTopicUpdateParameters. +func (p PartnerTopicUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationInfo. -func (o *OperationInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicUpdateParameters. +func (p *PartnerTopicUpdateParameters) 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", o, err) + 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", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationsListResult. -func (o OperationsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerTopicsListResult. +func (p PartnerTopicsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", o.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsListResult. -func (o *OperationsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicsListResult. +func (p *PartnerTopicsListResult) 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", o, err) + 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", &o.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Partner. -func (p Partner) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerUpdateDestinationInfo. +func (p PartnerUpdateDestinationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "authorizationExpirationTimeInUtc", p.AuthorizationExpirationTimeInUTC) - populate(objectMap, "partnerName", p.PartnerName) - populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + objectMap["endpointType"] = p.EndpointType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Partner. -func (p *Partner) UnmarshalJSON(data []byte) error { +// 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) @@ -2380,14 +5278,8 @@ func (p *Partner) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "authorizationExpirationTimeInUtc": - err = unpopulateTimeRFC3339(val, "AuthorizationExpirationTimeInUTC", &p.AuthorizationExpirationTimeInUTC) - delete(rawMsg, key) - case "partnerName": - err = unpopulate(val, "PartnerName", &p.PartnerName) - delete(rawMsg, key) - case "partnerRegistrationImmutableId": - err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) + case "endpointType": + err = unpopulate(val, "EndpointType", &p.EndpointType) delete(rawMsg, key) } if err != nil { @@ -2397,16 +5289,15 @@ func (p *Partner) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerAuthorization. -func (p PartnerAuthorization) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartnerUpdateTopicInfo. +func (p PartnerUpdateTopicInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorizedPartnersList", p.AuthorizedPartnersList) - populate(objectMap, "defaultMaximumExpirationTimeInDays", p.DefaultMaximumExpirationTimeInDays) + populate(objectMap, "eventTypeInfo", p.EventTypeInfo) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerAuthorization. -func (p *PartnerAuthorization) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerUpdateTopicInfo. +func (p *PartnerUpdateTopicInfo) 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) @@ -2414,11 +5305,8 @@ func (p *PartnerAuthorization) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "authorizedPartnersList": - err = unpopulate(val, "AuthorizedPartnersList", &p.AuthorizedPartnersList) - delete(rawMsg, key) - case "defaultMaximumExpirationTimeInDays": - err = unpopulate(val, "DefaultMaximumExpirationTimeInDays", &p.DefaultMaximumExpirationTimeInDays) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) delete(rawMsg, key) } if err != nil { @@ -2428,21 +5316,19 @@ func (p *PartnerAuthorization) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerConfiguration. -func (p PartnerConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PermissionBinding. +func (p PermissionBinding) 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 PartnerConfiguration. -func (p *PartnerConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PermissionBinding. +func (p *PermissionBinding) 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) @@ -2453,9 +5339,6 @@ func (p *PartnerConfiguration) UnmarshalJSON(data []byte) error { 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) @@ -2465,9 +5348,6 @@ func (p *PartnerConfiguration) UnmarshalJSON(data []byte) error { 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) @@ -2479,16 +5359,19 @@ func (p *PartnerConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationProperties. -func (p PartnerConfigurationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PermissionBindingProperties. +func (p PermissionBindingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "partnerAuthorization", p.PartnerAuthorization) + populate(objectMap, "clientGroupName", p.ClientGroupName) + populate(objectMap, "description", p.Description) + populate(objectMap, "permission", p.Permission) populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "topicSpaceName", p.TopicSpaceName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationProperties. -func (p *PartnerConfigurationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PermissionBindingProperties. +func (p *PermissionBindingProperties) 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) @@ -2496,69 +5379,20 @@ func (p *PartnerConfigurationProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "partnerAuthorization": - err = unpopulate(val, "PartnerAuthorization", &p.PartnerAuthorization) + case "clientGroupName": + err = unpopulate(val, "ClientGroupName", &p.ClientGroupName) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "description": + err = unpopulate(val, "Description", &p.Description) 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 PartnerConfigurationUpdateParameterProperties. -func (p PartnerConfigurationUpdateParameterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultMaximumExpirationTimeInDays", p.DefaultMaximumExpirationTimeInDays) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationUpdateParameterProperties. -func (p *PartnerConfigurationUpdateParameterProperties) 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 "defaultMaximumExpirationTimeInDays": - err = unpopulate(val, "DefaultMaximumExpirationTimeInDays", &p.DefaultMaximumExpirationTimeInDays) + case "permission": + err = unpopulate(val, "Permission", &p.Permission) 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 PartnerConfigurationUpdateParameters. -func (p PartnerConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationUpdateParameters. -func (p *PartnerConfigurationUpdateParameters) 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 "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "topicSpaceName": + err = unpopulate(val, "TopicSpaceName", &p.TopicSpaceName) delete(rawMsg, key) } if err != nil { @@ -2568,16 +5402,16 @@ func (p *PartnerConfigurationUpdateParameters) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationsListResult. -func (p PartnerConfigurationsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PermissionBindingsListResult. +func (p PermissionBindingsListResult) 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 PartnerConfigurationsListResult. -func (p *PartnerConfigurationsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PermissionBindingsListResult. +func (p *PermissionBindingsListResult) 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) @@ -2599,17 +5433,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) { - objectMap := make(map[string]any) - populate(objectMap, "description", p.Description) - populate(objectMap, "longDescription", p.LongDescription) - populate(objectMap, "setupUri", p.SetupURI) +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) 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 PrivateEndpoint. +func (p *PrivateEndpoint) 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) @@ -2617,14 +5449,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 "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) } if err != nil { @@ -2634,21 +5460,18 @@ func (p *PartnerDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerNamespace. -func (p PartnerNamespace) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) 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 PartnerNamespace. -func (p *PartnerNamespace) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) 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) @@ -2659,21 +5482,12 @@ func (p *PartnerNamespace) UnmarshalJSON(data []byte) error { 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) @@ -2685,22 +5499,16 @@ func (p *PartnerNamespace) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceProperties. -func (p PartnerNamespaceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) - populate(objectMap, "endpoint", p.Endpoint) - populate(objectMap, "inboundIpRules", p.InboundIPRules) - populate(objectMap, "partnerRegistrationFullyQualifiedId", p.PartnerRegistrationFullyQualifiedID) - populate(objectMap, "partnerTopicRoutingMode", p.PartnerTopicRoutingMode) - populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceProperties. -func (p *PartnerNamespaceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) 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) @@ -2708,29 +5516,11 @@ func (p *PartnerNamespaceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &p.DisableLocalAuth) - delete(rawMsg, key) - case "endpoint": - err = unpopulate(val, "Endpoint", &p.Endpoint) - delete(rawMsg, key) - case "inboundIpRules": - err = unpopulate(val, "InboundIPRules", &p.InboundIPRules) - delete(rawMsg, key) - case "partnerRegistrationFullyQualifiedId": - err = unpopulate(val, "PartnerRegistrationFullyQualifiedID", &p.PartnerRegistrationFullyQualifiedID) - delete(rawMsg, key) - case "partnerTopicRoutingMode": - err = unpopulate(val, "PartnerTopicRoutingMode", &p.PartnerTopicRoutingMode) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &p.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &p.PublicNetworkAccess) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -2740,15 +5530,18 @@ func (p *PartnerNamespaceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceRegenerateKeyRequest. -func (p PartnerNamespaceRegenerateKeyRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keyName", p.KeyName) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceRegenerateKeyRequest. -func (p *PartnerNamespaceRegenerateKeyRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) 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) @@ -2756,8 +5549,17 @@ func (p *PartnerNamespaceRegenerateKeyRequest) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "keyName": - err = unpopulate(val, "KeyName", &p.KeyName) + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -2767,16 +5569,18 @@ func (p *PartnerNamespaceRegenerateKeyRequest) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceSharedAccessKeys. -func (p PartnerNamespaceSharedAccessKeys) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key1", p.Key1) - populate(objectMap, "key2", p.Key2) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceSharedAccessKeys. -func (p *PartnerNamespaceSharedAccessKeys) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) 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) @@ -2784,11 +5588,17 @@ func (p *PartnerNamespaceSharedAccessKeys) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key1": - err = unpopulate(val, "Key1", &p.Key1) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "key2": - err = unpopulate(val, "Key2", &p.Key2) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { @@ -2798,17 +5608,18 @@ func (p *PartnerNamespaceSharedAccessKeys) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceUpdateParameterProperties. -func (p PartnerNamespaceUpdateParameterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) - populate(objectMap, "inboundIpRules", p.InboundIPRules) - populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceUpdateParameterProperties. -func (p *PartnerNamespaceUpdateParameterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) 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) @@ -2816,14 +5627,17 @@ func (p *PartnerNamespaceUpdateParameterProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &p.DisableLocalAuth) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) - case "inboundIpRules": - err = unpopulate(val, "InboundIPRules", &p.InboundIPRules) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &p.PublicNetworkAccess) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { @@ -2833,16 +5647,16 @@ func (p *PartnerNamespaceUpdateParameterProperties) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceUpdateParameters. -func (p PartnerNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesListResult. +func (p PrivateLinkResourcesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceUpdateParameters. -func (p *PartnerNamespaceUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourcesListResult. +func (p *PrivateLinkResourcesListResult) 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) @@ -2850,11 +5664,11 @@ func (p *PartnerNamespaceUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -2864,740 +5678,700 @@ func (p *PartnerNamespaceUpdateParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerNamespacesListResult. -func (p PartnerNamespacesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueueInfo. +func (q QueueInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "deadLetterDestinationWithResourceIdentity", q.DeadLetterDestinationWithResourceIdentity) + populate(objectMap, "eventTimeToLive", q.EventTimeToLive) + populate(objectMap, "maxDeliveryCount", q.MaxDeliveryCount) + populate(objectMap, "receiveLockDurationInSeconds", q.ReceiveLockDurationInSeconds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespacesListResult. -func (p *PartnerNamespacesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QueueInfo. +func (q *QueueInfo) 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) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "deadLetterDestinationWithResourceIdentity": + err = unpopulate(val, "DeadLetterDestinationWithResourceIdentity", &q.DeadLetterDestinationWithResourceIdentity) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "eventTimeToLive": + err = unpopulate(val, "EventTimeToLive", &q.EventTimeToLive) + delete(rawMsg, key) + case "maxDeliveryCount": + err = unpopulate(val, "MaxDeliveryCount", &q.MaxDeliveryCount) + delete(rawMsg, key) + case "receiveLockDurationInSeconds": + err = unpopulate(val, "ReceiveLockDurationInSeconds", &q.ReceiveLockDurationInSeconds) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerRegistration. -func (p PartnerRegistration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) 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) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistration. -func (p *PartnerRegistration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, 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) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + } + 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) + populateTimeRFC3339(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 "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "changedTimeUtc": + err = unpopulateTimeRFC3339(val, "ChangedTimeUTC", &r.ChangedTimeUTC) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &r.ResourceGroupName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationProperties. -func (p PartnerRegistrationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceSKU. +func (r ResourceSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "name", r.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationProperties. -func (p *PartnerRegistrationProperties) UnmarshalJSON(data []byte) error { +// 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "partnerRegistrationImmutableId": - err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationUpdateParameters. -func (p PartnerRegistrationUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RetryPolicy. +func (r RetryPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", p.Tags) + populate(objectMap, "eventTimeToLiveInMinutes", r.EventTimeToLiveInMinutes) + populate(objectMap, "maxDeliveryAttempts", r.MaxDeliveryAttempts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationUpdateParameters. -func (p *PartnerRegistrationUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RetryPolicy. +func (r *RetryPolicy) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "eventTimeToLiveInMinutes": + err = unpopulate(val, "EventTimeToLiveInMinutes", &r.EventTimeToLiveInMinutes) + delete(rawMsg, key) + case "maxDeliveryAttempts": + err = unpopulate(val, "MaxDeliveryAttempts", &r.MaxDeliveryAttempts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationsListResult. -func (p PartnerRegistrationsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RoutingEnrichments. +func (r RoutingEnrichments) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "dynamic", r.Dynamic) + populate(objectMap, "static", r.Static) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationsListResult. -func (p *PartnerRegistrationsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingEnrichments. +func (r *RoutingEnrichments) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "dynamic": + err = unpopulate(val, "Dynamic", &r.Dynamic) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "static": + err = unpopulate(val, "Static", &r.Static) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerTopic. -func (p PartnerTopic) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RoutingIdentityInfo. +func (r RoutingIdentityInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "identity", p.Identity) - 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) + populate(objectMap, "type", r.Type) + populate(objectMap, "userAssignedIdentity", r.UserAssignedIdentity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopic. -func (p *PartnerTopic) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingIdentityInfo. +func (r *RoutingIdentityInfo) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &p.Identity) - 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) + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &r.UserAssignedIdentity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerTopicInfo. -func (p PartnerTopicInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceBusQueueEventSubscriptionDestination. +func (s ServiceBusQueueEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureSubscriptionId", p.AzureSubscriptionID) - populate(objectMap, "eventTypeInfo", p.EventTypeInfo) - populate(objectMap, "name", p.Name) - populate(objectMap, "resourceGroupName", p.ResourceGroupName) - populate(objectMap, "source", p.Source) + objectMap["endpointType"] = EndpointTypeServiceBusQueue + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicInfo. -func (p *PartnerTopicInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueEventSubscriptionDestination. +func (s *ServiceBusQueueEventSubscriptionDestination) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "azureSubscriptionId": - err = unpopulate(val, "AzureSubscriptionID", &p.AzureSubscriptionID) - delete(rawMsg, key) - case "eventTypeInfo": - err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "resourceGroupName": - err = unpopulate(val, "ResourceGroupName", &p.ResourceGroupName) + case "endpointType": + err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &p.Source) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerTopicProperties. -func (p PartnerTopicProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceBusQueueEventSubscriptionDestinationProperties. +func (s ServiceBusQueueEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activationState", p.ActivationState) - populate(objectMap, "eventTypeInfo", p.EventTypeInfo) - populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", p.ExpirationTimeIfNotActivatedUTC) - populate(objectMap, "messageForActivation", p.MessageForActivation) - populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) - populate(objectMap, "partnerTopicFriendlyDescription", p.PartnerTopicFriendlyDescription) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "source", p.Source) + populate(objectMap, "deliveryAttributeMappings", s.DeliveryAttributeMappings) + populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicProperties. -func (p *PartnerTopicProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueEventSubscriptionDestinationProperties. +func (s *ServiceBusQueueEventSubscriptionDestinationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "activationState": - err = unpopulate(val, "ActivationState", &p.ActivationState) - delete(rawMsg, key) - case "eventTypeInfo": - err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) - delete(rawMsg, key) - case "expirationTimeIfNotActivatedUtc": - err = unpopulateTimeRFC3339(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 "partnerTopicFriendlyDescription": - err = unpopulate(val, "PartnerTopicFriendlyDescription", &p.PartnerTopicFriendlyDescription) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "deliveryAttributeMappings": + s.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &p.Source) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerTopicUpdateParameters. -func (p PartnerTopicUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceBusTopicEventSubscriptionDestination. +func (s ServiceBusTopicEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "tags", p.Tags) + objectMap["endpointType"] = EndpointTypeServiceBusTopic + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicUpdateParameters. -func (p *PartnerTopicUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicEventSubscriptionDestination. +func (s *ServiceBusTopicEventSubscriptionDestination) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &p.Identity) + case "endpointType": + err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerTopicsListResult. -func (p PartnerTopicsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceBusTopicEventSubscriptionDestinationProperties. +func (s ServiceBusTopicEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "deliveryAttributeMappings", s.DeliveryAttributeMappings) + populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicsListResult. -func (p *PartnerTopicsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicEventSubscriptionDestinationProperties. +func (s *ServiceBusTopicEventSubscriptionDestinationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "deliveryAttributeMappings": + s.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartnerUpdateTopicInfo. -func (p PartnerUpdateTopicInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StaticDeliveryAttributeMapping. +func (s StaticDeliveryAttributeMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "eventTypeInfo", p.EventTypeInfo) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + objectMap["type"] = DeliveryAttributeMappingTypeStatic return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerUpdateTopicInfo. -func (p *PartnerUpdateTopicInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticDeliveryAttributeMapping. +func (s *StaticDeliveryAttributeMapping) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "eventTypeInfo": - err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StaticDeliveryAttributeMappingProperties. +func (s StaticDeliveryAttributeMappingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + populate(objectMap, "isSecret", s.IsSecret) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticDeliveryAttributeMappingProperties. +func (s *StaticDeliveryAttributeMappingProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "isSecret": + err = unpopulate(val, "IsSecret", &s.IsSecret) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StaticRoutingEnrichment. +func (s StaticRoutingEnrichment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "key", s.Key) + populate(objectMap, "valueType", s.ValueType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticRoutingEnrichment. +func (s *StaticRoutingEnrichment) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "valueType": + err = unpopulate(val, "ValueType", &s.ValueType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageBlobDeadLetterDestination. +func (s StorageBlobDeadLetterDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + objectMap["endpointType"] = DeadLetterEndPointTypeStorageBlob + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlobDeadLetterDestination. +func (s *StorageBlobDeadLetterDestination) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "endpointType": + err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageBlobDeadLetterDestinationProperties. +func (s StorageBlobDeadLetterDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "blobContainerName", s.BlobContainerName) + populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlobDeadLetterDestinationProperties. +func (s *StorageBlobDeadLetterDestinationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "groupIds": - err = unpopulate(val, "GroupIDs", &p.GroupIDs) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "blobContainerName": + err = unpopulate(val, "BlobContainerName", &s.BlobContainerName) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageQueueEventSubscriptionDestination. +func (s StorageQueueEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + objectMap["endpointType"] = EndpointTypeStorageQueue + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageQueueEventSubscriptionDestination. +func (s *StorageQueueEventSubscriptionDestination) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "endpointType": + err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageQueueEventSubscriptionDestinationProperties. +func (s StorageQueueEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", p.DisplayName) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + populate(objectMap, "queueMessageTimeToLiveInSeconds", s.QueueMessageTimeToLiveInSeconds) + populate(objectMap, "queueName", s.QueueName) + populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageQueueEventSubscriptionDestinationProperties. +func (s *StorageQueueEventSubscriptionDestinationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &p.DisplayName) - delete(rawMsg, key) - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) + case "queueMessageTimeToLiveInSeconds": + err = unpopulate(val, "QueueMessageTimeToLiveInSeconds", &s.QueueMessageTimeToLiveInSeconds) delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "queueName": + err = unpopulate(val, "QueueName", &s.QueueName) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesListResult. -func (p PrivateLinkResourcesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringBeginsWithAdvancedFilter. +func (s StringBeginsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringBeginsWith + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourcesListResult. -func (p *PrivateLinkResourcesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringBeginsWithAdvancedFilter. +func (s *StringBeginsWithAdvancedFilter) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringBeginsWithFilter. +func (s StringBeginsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = FilterOperatorTypeStringBeginsWith + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringBeginsWithFilter. +func (s *StringBeginsWithFilter) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RetryPolicy. -func (r RetryPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringContainsAdvancedFilter. +func (s StringContainsAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "eventTimeToLiveInMinutes", r.EventTimeToLiveInMinutes) - populate(objectMap, "maxDeliveryAttempts", r.MaxDeliveryAttempts) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringContains + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RetryPolicy. -func (r *RetryPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringContainsAdvancedFilter. +func (s *StringContainsAdvancedFilter) 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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "eventTimeToLiveInMinutes": - err = unpopulate(val, "EventTimeToLiveInMinutes", &r.EventTimeToLiveInMinutes) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "maxDeliveryAttempts": - err = unpopulate(val, "MaxDeliveryAttempts", &r.MaxDeliveryAttempts) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceBusQueueEventSubscriptionDestination. -func (s ServiceBusQueueEventSubscriptionDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringContainsFilter. +func (s StringContainsFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = EndpointTypeServiceBusQueue - populate(objectMap, "properties", s.Properties) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = FilterOperatorTypeStringContains + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueEventSubscriptionDestination. -func (s *ServiceBusQueueEventSubscriptionDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringContainsFilter. +func (s *StringContainsFilter) 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", s, err) @@ -3605,11 +6379,14 @@ func (s *ServiceBusQueueEventSubscriptionDestination) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "endpointType": - err = unpopulate(val, "EndpointType", &s.EndpointType) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3619,16 +6396,17 @@ func (s *ServiceBusQueueEventSubscriptionDestination) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceBusQueueEventSubscriptionDestinationProperties. -func (s ServiceBusQueueEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringEndsWithAdvancedFilter. +func (s StringEndsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deliveryAttributeMappings", s.DeliveryAttributeMappings) - populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringEndsWith + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueEventSubscriptionDestinationProperties. -func (s *ServiceBusQueueEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringEndsWithAdvancedFilter. +func (s *StringEndsWithAdvancedFilter) 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", s, err) @@ -3636,11 +6414,14 @@ func (s *ServiceBusQueueEventSubscriptionDestinationProperties) UnmarshalJSON(da for key, val := range rawMsg { var err error switch key { - case "deliveryAttributeMappings": - s.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &s.ResourceID) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3650,16 +6431,17 @@ func (s *ServiceBusQueueEventSubscriptionDestinationProperties) UnmarshalJSON(da return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceBusTopicEventSubscriptionDestination. -func (s ServiceBusTopicEventSubscriptionDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringEndsWithFilter. +func (s StringEndsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = EndpointTypeServiceBusTopic - populate(objectMap, "properties", s.Properties) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = FilterOperatorTypeStringEndsWith + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicEventSubscriptionDestination. -func (s *ServiceBusTopicEventSubscriptionDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringEndsWithFilter. +func (s *StringEndsWithFilter) 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", s, err) @@ -3667,11 +6449,14 @@ func (s *ServiceBusTopicEventSubscriptionDestination) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "endpointType": - err = unpopulate(val, "EndpointType", &s.EndpointType) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3681,16 +6466,17 @@ func (s *ServiceBusTopicEventSubscriptionDestination) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceBusTopicEventSubscriptionDestinationProperties. -func (s ServiceBusTopicEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringInAdvancedFilter. +func (s StringInAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deliveryAttributeMappings", s.DeliveryAttributeMappings) - populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringIn + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicEventSubscriptionDestinationProperties. -func (s *ServiceBusTopicEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringInAdvancedFilter. +func (s *StringInAdvancedFilter) 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", s, err) @@ -3698,11 +6484,14 @@ func (s *ServiceBusTopicEventSubscriptionDestinationProperties) UnmarshalJSON(da for key, val := range rawMsg { var err error switch key { - case "deliveryAttributeMappings": - s.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &s.ResourceID) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3712,17 +6501,17 @@ func (s *ServiceBusTopicEventSubscriptionDestinationProperties) UnmarshalJSON(da return nil } -// MarshalJSON implements the json.Marshaller interface for type StaticDeliveryAttributeMapping. -func (s StaticDeliveryAttributeMapping) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringInFilter. +func (s StringInFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - objectMap["type"] = DeliveryAttributeMappingTypeStatic + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = FilterOperatorTypeStringIn + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StaticDeliveryAttributeMapping. -func (s *StaticDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringInFilter. +func (s *StringInFilter) 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", s, err) @@ -3730,14 +6519,14 @@ func (s *StaticDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3747,16 +6536,17 @@ func (s *StaticDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StaticDeliveryAttributeMappingProperties. -func (s StaticDeliveryAttributeMappingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotBeginsWithAdvancedFilter. +func (s StringNotBeginsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isSecret", s.IsSecret) - populate(objectMap, "value", s.Value) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotBeginsWith + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StaticDeliveryAttributeMappingProperties. -func (s *StaticDeliveryAttributeMappingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotBeginsWithAdvancedFilter. +func (s *StringNotBeginsWithAdvancedFilter) 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", s, err) @@ -3764,11 +6554,14 @@ func (s *StaticDeliveryAttributeMappingProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "isSecret": - err = unpopulate(val, "IsSecret", &s.IsSecret) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3778,16 +6571,17 @@ func (s *StaticDeliveryAttributeMappingProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageBlobDeadLetterDestination. -func (s StorageBlobDeadLetterDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotBeginsWithFilter. +func (s StringNotBeginsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = DeadLetterEndPointTypeStorageBlob - populate(objectMap, "properties", s.Properties) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = FilterOperatorTypeStringNotBeginsWith + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlobDeadLetterDestination. -func (s *StorageBlobDeadLetterDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotBeginsWithFilter. +func (s *StringNotBeginsWithFilter) 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", s, err) @@ -3795,11 +6589,14 @@ func (s *StorageBlobDeadLetterDestination) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endpointType": - err = unpopulate(val, "EndpointType", &s.EndpointType) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3809,16 +6606,17 @@ func (s *StorageBlobDeadLetterDestination) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageBlobDeadLetterDestinationProperties. -func (s StorageBlobDeadLetterDestinationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotContainsAdvancedFilter. +func (s StringNotContainsAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "blobContainerName", s.BlobContainerName) - populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotContains + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlobDeadLetterDestinationProperties. -func (s *StorageBlobDeadLetterDestinationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotContainsAdvancedFilter. +func (s *StringNotContainsAdvancedFilter) 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", s, err) @@ -3826,11 +6624,14 @@ func (s *StorageBlobDeadLetterDestinationProperties) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "blobContainerName": - err = unpopulate(val, "BlobContainerName", &s.BlobContainerName) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &s.ResourceID) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3840,16 +6641,17 @@ func (s *StorageBlobDeadLetterDestinationProperties) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageQueueEventSubscriptionDestination. -func (s StorageQueueEventSubscriptionDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotContainsFilter. +func (s StringNotContainsFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["endpointType"] = EndpointTypeStorageQueue - populate(objectMap, "properties", s.Properties) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = FilterOperatorTypeStringNotContains + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageQueueEventSubscriptionDestination. -func (s *StorageQueueEventSubscriptionDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotContainsFilter. +func (s *StringNotContainsFilter) 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", s, err) @@ -3857,11 +6659,14 @@ func (s *StorageQueueEventSubscriptionDestination) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "endpointType": - err = unpopulate(val, "EndpointType", &s.EndpointType) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3871,17 +6676,17 @@ func (s *StorageQueueEventSubscriptionDestination) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageQueueEventSubscriptionDestinationProperties. -func (s StorageQueueEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotEndsWithAdvancedFilter. +func (s StringNotEndsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "queueMessageTimeToLiveInSeconds", s.QueueMessageTimeToLiveInSeconds) - populate(objectMap, "queueName", s.QueueName) - populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "key", s.Key) + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotEndsWith + populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageQueueEventSubscriptionDestinationProperties. -func (s *StorageQueueEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotEndsWithAdvancedFilter. +func (s *StringNotEndsWithAdvancedFilter) 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", s, err) @@ -3889,14 +6694,14 @@ func (s *StorageQueueEventSubscriptionDestinationProperties) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "queueMessageTimeToLiveInSeconds": - err = unpopulate(val, "QueueMessageTimeToLiveInSeconds", &s.QueueMessageTimeToLiveInSeconds) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "queueName": - err = unpopulate(val, "QueueName", &s.QueueName) + case "operatorType": + err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &s.ResourceID) + case "values": + err = unpopulate(val, "Values", &s.Values) delete(rawMsg, key) } if err != nil { @@ -3906,17 +6711,17 @@ func (s *StorageQueueEventSubscriptionDestinationProperties) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type StringBeginsWithAdvancedFilter. -func (s StringBeginsWithAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotEndsWithFilter. +func (s StringNotEndsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringBeginsWith + objectMap["operatorType"] = FilterOperatorTypeStringNotEndsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringBeginsWithAdvancedFilter. -func (s *StringBeginsWithAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotEndsWithFilter. +func (s *StringNotEndsWithFilter) 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", s, err) @@ -3941,17 +6746,17 @@ func (s *StringBeginsWithAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StringContainsAdvancedFilter. -func (s StringContainsAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotInAdvancedFilter. +func (s StringNotInAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringContains + objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotIn populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringContainsAdvancedFilter. -func (s *StringContainsAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotInAdvancedFilter. +func (s *StringNotInAdvancedFilter) 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", s, err) @@ -3976,17 +6781,17 @@ func (s *StringContainsAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StringEndsWithAdvancedFilter. -func (s StringEndsWithAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StringNotInFilter. +func (s StringNotInFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringEndsWith + objectMap["operatorType"] = FilterOperatorTypeStringNotIn populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringEndsWithAdvancedFilter. -func (s *StringEndsWithAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotInFilter. +func (s *StringNotInFilter) 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", s, err) @@ -4011,17 +6816,19 @@ func (s *StringEndsWithAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StringInAdvancedFilter. -func (s StringInAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Subscription. +func (s Subscription) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringIn - populate(objectMap, "values", s.Values) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringInAdvancedFilter. -func (s *StringInAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Subscription. +func (s *Subscription) 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", s, err) @@ -4029,14 +6836,20 @@ func (s *StringInAdvancedFilter) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &s.Key) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &s.OperatorType) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &s.Values) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -4046,17 +6859,18 @@ func (s *StringInAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StringNotBeginsWithAdvancedFilter. -func (s StringNotBeginsWithAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubscriptionProperties. +func (s SubscriptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotBeginsWith - populate(objectMap, "values", s.Values) + populate(objectMap, "deliveryConfiguration", s.DeliveryConfiguration) + populate(objectMap, "eventDeliverySchema", s.EventDeliverySchema) + populate(objectMap, "filtersConfiguration", s.FiltersConfiguration) + populate(objectMap, "provisioningState", s.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotBeginsWithAdvancedFilter. -func (s *StringNotBeginsWithAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionProperties. +func (s *SubscriptionProperties) 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", s, err) @@ -4064,14 +6878,17 @@ func (s *StringNotBeginsWithAdvancedFilter) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &s.Key) + case "deliveryConfiguration": + err = unpopulate(val, "DeliveryConfiguration", &s.DeliveryConfiguration) delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &s.OperatorType) + case "eventDeliverySchema": + err = unpopulate(val, "EventDeliverySchema", &s.EventDeliverySchema) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &s.Values) + case "filtersConfiguration": + err = unpopulate(val, "FiltersConfiguration", &s.FiltersConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -4081,17 +6898,15 @@ func (s *StringNotBeginsWithAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StringNotContainsAdvancedFilter. -func (s StringNotContainsAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParameters. +func (s SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotContains - populate(objectMap, "values", s.Values) + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotContainsAdvancedFilter. -func (s *StringNotContainsAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParameters. +func (s *SubscriptionUpdateParameters) 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", s, err) @@ -4099,14 +6914,8 @@ func (s *StringNotContainsAdvancedFilter) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &s.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &s.OperatorType) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &s.Values) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { @@ -4116,17 +6925,17 @@ func (s *StringNotContainsAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StringNotEndsWithAdvancedFilter. -func (s StringNotEndsWithAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParametersProperties. +func (s SubscriptionUpdateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotEndsWith - populate(objectMap, "values", s.Values) + populate(objectMap, "deliveryConfiguration", s.DeliveryConfiguration) + populate(objectMap, "eventDeliverySchema", s.EventDeliverySchema) + populate(objectMap, "filtersConfiguration", s.FiltersConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotEndsWithAdvancedFilter. -func (s *StringNotEndsWithAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParametersProperties. +func (s *SubscriptionUpdateParametersProperties) 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", s, err) @@ -4134,14 +6943,14 @@ func (s *StringNotEndsWithAdvancedFilter) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &s.Key) + case "deliveryConfiguration": + err = unpopulate(val, "DeliveryConfiguration", &s.DeliveryConfiguration) delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &s.OperatorType) + case "eventDeliverySchema": + err = unpopulate(val, "EventDeliverySchema", &s.EventDeliverySchema) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &s.Values) + case "filtersConfiguration": + err = unpopulate(val, "FiltersConfiguration", &s.FiltersConfiguration) delete(rawMsg, key) } if err != nil { @@ -4151,17 +6960,16 @@ func (s *StringNotEndsWithAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StringNotInAdvancedFilter. -func (s StringNotInAdvancedFilter) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubscriptionsListResult. +func (s SubscriptionsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", s.Key) - objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotIn - populate(objectMap, "values", s.Values) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StringNotInAdvancedFilter. -func (s *StringNotInAdvancedFilter) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionsListResult. +func (s *SubscriptionsListResult) 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", s, err) @@ -4169,14 +6977,11 @@ func (s *StringNotInAdvancedFilter) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &s.Key) - delete(rawMsg, key) - case "operatorType": - err = unpopulate(val, "OperatorType", &s.OperatorType) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &s.Values) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -4352,59 +7157,252 @@ func (s *SystemTopicUpdateParameters) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemTopicsListResult. +func (s SystemTopicsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemTopicsListResult. +func (s *SystemTopicsListResult) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// 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) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Topic. +func (t *Topic) 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", t, err) + } + 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) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + 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) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TopicProperties. +func (t TopicProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataResidencyBoundary", t.DataResidencyBoundary) + populate(objectMap, "disableLocalAuth", t.DisableLocalAuth) + populate(objectMap, "endpoint", t.Endpoint) + populate(objectMap, "eventTypeInfo", t.EventTypeInfo) + populate(objectMap, "inboundIpRules", t.InboundIPRules) + populate(objectMap, "inputSchema", t.InputSchema) + populate(objectMap, "inputSchemaMapping", t.InputSchemaMapping) + populate(objectMap, "metricResourceId", t.MetricResourceID) + populate(objectMap, "minimumTlsVersionAllowed", t.MinimumTLSVersionAllowed) + populate(objectMap, "privateEndpointConnections", t.PrivateEndpointConnections) + populate(objectMap, "provisioningState", t.ProvisioningState) + populate(objectMap, "publicNetworkAccess", t.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicProperties. +func (t *TopicProperties) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataResidencyBoundary": + err = unpopulate(val, "DataResidencyBoundary", &t.DataResidencyBoundary) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &t.DisableLocalAuth) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &t.Endpoint) + delete(rawMsg, key) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &t.EventTypeInfo) + delete(rawMsg, key) + case "inboundIpRules": + err = unpopulate(val, "InboundIPRules", &t.InboundIPRules) + delete(rawMsg, key) + case "inputSchema": + err = unpopulate(val, "InputSchema", &t.InputSchema) + delete(rawMsg, key) + case "inputSchemaMapping": + t.InputSchemaMapping, err = unmarshalInputSchemaMappingClassification(val) + delete(rawMsg, key) + case "metricResourceId": + err = unpopulate(val, "MetricResourceID", &t.MetricResourceID) + delete(rawMsg, key) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &t.MinimumTLSVersionAllowed) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &t.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &t.PublicNetworkAccess) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TopicRegenerateKeyRequest. +func (t TopicRegenerateKeyRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyName", t.KeyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicRegenerateKeyRequest. +func (t *TopicRegenerateKeyRequest) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyName": + err = unpopulate(val, "KeyName", &t.KeyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SystemTopicsListResult. -func (s SystemTopicsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TopicSharedAccessKeys. +func (t TopicSharedAccessKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "key1", t.Key1) + populate(objectMap, "key2", t.Key2) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemTopicsListResult. -func (s *SystemTopicsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicSharedAccessKeys. +func (t *TopicSharedAccessKeys) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "key1": + err = unpopulate(val, "Key1", &t.Key1) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "key2": + err = unpopulate(val, "Key2", &t.Key2) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Topic. -func (t Topic) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TopicSpace. +func (t TopicSpace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) - populate(objectMap, "identity", t.Identity) - populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Topic. -func (t *Topic) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpace. +func (t *TopicSpace) 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", t, err) @@ -4415,12 +7413,6 @@ func (t *Topic) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &t.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) @@ -4430,9 +7422,6 @@ func (t *Topic) UnmarshalJSON(data []byte) error { case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) @@ -4444,24 +7433,17 @@ func (t *Topic) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TopicProperties. -func (t TopicProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TopicSpaceProperties. +func (t TopicSpaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataResidencyBoundary", t.DataResidencyBoundary) - populate(objectMap, "disableLocalAuth", t.DisableLocalAuth) - populate(objectMap, "endpoint", t.Endpoint) - populate(objectMap, "inboundIpRules", t.InboundIPRules) - populate(objectMap, "inputSchema", t.InputSchema) - populate(objectMap, "inputSchemaMapping", t.InputSchemaMapping) - populate(objectMap, "metricResourceId", t.MetricResourceID) - populate(objectMap, "privateEndpointConnections", t.PrivateEndpointConnections) + populate(objectMap, "description", t.Description) populate(objectMap, "provisioningState", t.ProvisioningState) - populate(objectMap, "publicNetworkAccess", t.PublicNetworkAccess) + populate(objectMap, "topicTemplates", t.TopicTemplates) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TopicProperties. -func (t *TopicProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpaceProperties. +func (t *TopicSpaceProperties) 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", t, err) @@ -4469,35 +7451,14 @@ func (t *TopicProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dataResidencyBoundary": - err = unpopulate(val, "DataResidencyBoundary", &t.DataResidencyBoundary) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &t.DisableLocalAuth) - delete(rawMsg, key) - case "endpoint": - err = unpopulate(val, "Endpoint", &t.Endpoint) - delete(rawMsg, key) - case "inboundIpRules": - err = unpopulate(val, "InboundIPRules", &t.InboundIPRules) - delete(rawMsg, key) - case "inputSchema": - err = unpopulate(val, "InputSchema", &t.InputSchema) - delete(rawMsg, key) - case "inputSchemaMapping": - t.InputSchemaMapping, err = unmarshalInputSchemaMappingClassification(val) - delete(rawMsg, key) - case "metricResourceId": - err = unpopulate(val, "MetricResourceID", &t.MetricResourceID) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &t.PrivateEndpointConnections) + case "description": + err = unpopulate(val, "Description", &t.Description) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &t.PublicNetworkAccess) + case "topicTemplates": + err = unpopulate(val, "TopicTemplates", &t.TopicTemplates) delete(rawMsg, key) } if err != nil { @@ -4507,15 +7468,22 @@ func (t *TopicProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TopicRegenerateKeyRequest. -func (t TopicRegenerateKeyRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TopicSpacesConfiguration. +func (t TopicSpacesConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keyName", t.KeyName) + populate(objectMap, "clientAuthentication", t.ClientAuthentication) + populate(objectMap, "hostname", t.Hostname) + populate(objectMap, "maximumClientSessionsPerAuthenticationName", t.MaximumClientSessionsPerAuthenticationName) + populate(objectMap, "maximumSessionExpiryInHours", t.MaximumSessionExpiryInHours) + populate(objectMap, "routeTopicResourceId", t.RouteTopicResourceID) + populate(objectMap, "routingEnrichments", t.RoutingEnrichments) + populate(objectMap, "routingIdentityInfo", t.RoutingIdentityInfo) + populate(objectMap, "state", t.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TopicRegenerateKeyRequest. -func (t *TopicRegenerateKeyRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpacesConfiguration. +func (t *TopicSpacesConfiguration) 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", t, err) @@ -4523,8 +7491,29 @@ func (t *TopicRegenerateKeyRequest) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "keyName": - err = unpopulate(val, "KeyName", &t.KeyName) + case "clientAuthentication": + err = unpopulate(val, "ClientAuthentication", &t.ClientAuthentication) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &t.Hostname) + delete(rawMsg, key) + case "maximumClientSessionsPerAuthenticationName": + err = unpopulate(val, "MaximumClientSessionsPerAuthenticationName", &t.MaximumClientSessionsPerAuthenticationName) + delete(rawMsg, key) + case "maximumSessionExpiryInHours": + err = unpopulate(val, "MaximumSessionExpiryInHours", &t.MaximumSessionExpiryInHours) + delete(rawMsg, key) + case "routeTopicResourceId": + err = unpopulate(val, "RouteTopicResourceID", &t.RouteTopicResourceID) + delete(rawMsg, key) + case "routingEnrichments": + err = unpopulate(val, "RoutingEnrichments", &t.RoutingEnrichments) + delete(rawMsg, key) + case "routingIdentityInfo": + err = unpopulate(val, "RoutingIdentityInfo", &t.RoutingIdentityInfo) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &t.State) delete(rawMsg, key) } if err != nil { @@ -4534,16 +7523,16 @@ func (t *TopicRegenerateKeyRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TopicSharedAccessKeys. -func (t TopicSharedAccessKeys) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TopicSpacesListResult. +func (t TopicSpacesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key1", t.Key1) - populate(objectMap, "key2", t.Key2) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TopicSharedAccessKeys. -func (t *TopicSharedAccessKeys) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpacesListResult. +func (t *TopicSpacesListResult) 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", t, err) @@ -4551,11 +7540,11 @@ func (t *TopicSharedAccessKeys) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "key1": - err = unpopulate(val, "Key1", &t.Key1) + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) delete(rawMsg, key) - case "key2": - err = unpopulate(val, "Key2", &t.Key2) + case "value": + err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { @@ -4607,6 +7596,7 @@ func (t *TopicTypeInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopicTypeProperties. func (t TopicTypeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "areRegionalAndGlobalSourcesSupported", t.AreRegionalAndGlobalSourcesSupported) populate(objectMap, "description", t.Description) populate(objectMap, "displayName", t.DisplayName) populate(objectMap, "provider", t.Provider) @@ -4627,6 +7617,9 @@ func (t *TopicTypeProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "areRegionalAndGlobalSourcesSupported": + err = unpopulate(val, "AreRegionalAndGlobalSourcesSupported", &t.AreRegionalAndGlobalSourcesSupported) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &t.Description) delete(rawMsg, key) @@ -4691,7 +7684,9 @@ func (t TopicUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataResidencyBoundary", t.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", t.DisableLocalAuth) + populate(objectMap, "eventTypeInfo", t.EventTypeInfo) populate(objectMap, "inboundIpRules", t.InboundIPRules) + populate(objectMap, "minimumTlsVersionAllowed", t.MinimumTLSVersionAllowed) populate(objectMap, "publicNetworkAccess", t.PublicNetworkAccess) return json.Marshal(objectMap) } @@ -4711,9 +7706,15 @@ func (t *TopicUpdateParameterProperties) UnmarshalJSON(data []byte) error { case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &t.DisableLocalAuth) delete(rawMsg, key) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &t.EventTypeInfo) + delete(rawMsg, key) case "inboundIpRules": err = unpopulate(val, "InboundIPRules", &t.InboundIPRules) delete(rawMsg, key) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &t.MinimumTLSVersionAllowed) + delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &t.PublicNetworkAccess) delete(rawMsg, key) @@ -4730,6 +7731,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) } @@ -4749,6 +7751,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) @@ -4760,6 +7765,33 @@ func (t *TopicUpdateParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TopicsConfiguration. +func (t TopicsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostname", t.Hostname) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopicsConfiguration. +func (t *TopicsConfiguration) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostname": + err = unpopulate(val, "Hostname", &t.Hostname) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TopicsListResult. func (t TopicsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4834,6 +7866,57 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } +// 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, "maximumClientSessionsPerAuthenticationName", u.MaximumClientSessionsPerAuthenticationName) + populate(objectMap, "maximumSessionExpiryInHours", u.MaximumSessionExpiryInHours) + populate(objectMap, "routeTopicResourceId", u.RouteTopicResourceID) + populate(objectMap, "routingEnrichments", u.RoutingEnrichments) + populate(objectMap, "routingIdentityInfo", u.RoutingIdentityInfo) + populate(objectMap, "state", u.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateTopicSpacesConfigurationInfo. +func (u *UpdateTopicSpacesConfigurationInfo) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAuthentication": + err = unpopulate(val, "ClientAuthentication", &u.ClientAuthentication) + delete(rawMsg, key) + case "maximumClientSessionsPerAuthenticationName": + err = unpopulate(val, "MaximumClientSessionsPerAuthenticationName", &u.MaximumClientSessionsPerAuthenticationName) + delete(rawMsg, key) + case "maximumSessionExpiryInHours": + err = unpopulate(val, "MaximumSessionExpiryInHours", &u.MaximumSessionExpiryInHours) + delete(rawMsg, key) + case "routeTopicResourceId": + err = unpopulate(val, "RouteTopicResourceID", &u.RouteTopicResourceID) + delete(rawMsg, key) + case "routingEnrichments": + err = unpopulate(val, "RoutingEnrichments", &u.RoutingEnrichments) + delete(rawMsg, key) + case "routingIdentityInfo": + err = unpopulate(val, "RoutingIdentityInfo", &u.RoutingIdentityInfo) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserIdentityProperties. func (u UserIdentityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4912,6 +7995,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) @@ -4931,6 +8015,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) @@ -5022,6 +8109,7 @@ func (w WebHookEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, er populate(objectMap, "endpointBaseUrl", w.EndpointBaseURL) populate(objectMap, "endpointUrl", w.EndpointURL) populate(objectMap, "maxEventsPerBatch", w.MaxEventsPerBatch) + populate(objectMap, "minimumTlsVersionAllowed", w.MinimumTLSVersionAllowed) populate(objectMap, "preferredBatchSizeInKilobytes", w.PreferredBatchSizeInKilobytes) return json.Marshal(objectMap) } @@ -5053,6 +8141,9 @@ func (w *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(data []byt case "maxEventsPerBatch": err = unpopulate(val, "MaxEventsPerBatch", &w.MaxEventsPerBatch) delete(rawMsg, key) + case "minimumTlsVersionAllowed": + err = unpopulate(val, "MinimumTLSVersionAllowed", &w.MinimumTLSVersionAllowed) + delete(rawMsg, key) case "preferredBatchSizeInKilobytes": err = unpopulate(val, "PreferredBatchSizeInKilobytes", &w.PreferredBatchSizeInKilobytes) delete(rawMsg, key) @@ -5064,6 +8155,123 @@ func (w *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(data []byt 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 new file mode 100644 index 000000000000..6c54f0b4530a --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/namespaces_client.go @@ -0,0 +1,568 @@ +//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 + +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" +) + +// NamespacesClient contains the methods for the Namespaces group. +// Don't use this type directly, use NewNamespacesClient() instead. +type NamespacesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNamespacesClient creates a new instance of NamespacesClient 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 NewNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamespacesClient, error) { + cl, err := arm.NewClient(moduleName+".NamespacesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NamespacesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - namespaceInfo - Namespace information. +// - options - NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate +// method. +func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, namespaceInfo Namespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespacesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, namespaceInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespacesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespacesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 2023-06-01-preview +func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, namespaceInfo Namespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, namespaceInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, namespaceInfo Namespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, namespaceInfo) +} + +// BeginDelete - Delete existing namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*runtime.Poller[NamespacesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespacesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespacesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete existing namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +func (client *NamespacesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetOptions) (NamespacesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return NamespacesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespacesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespacesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-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 *NamespacesClient) getHandleResponse(resp *http.Response) (NamespacesClientGetResponse, error) { + result := NamespacesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Namespace); err != nil { + return NamespacesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the namespaces under a resource group. +// +// Generated from API version 2023-06-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. +func (client *NamespacesClient) NewListByResourceGroupPager(resourceGroupName string, options *NamespacesClientListByResourceGroupOptions) *runtime.Pager[NamespacesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[NamespacesClientListByResourceGroupResponse]{ + More: func(page NamespacesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NamespacesClientListByResourceGroupResponse) (NamespacesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NamespacesClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespacesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespacesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *NamespacesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces" + 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() + reqQP.Set("api-version", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *NamespacesClient) listByResourceGroupHandleResponse(resp *http.Response) (NamespacesClientListByResourceGroupResponse, error) { + result := NamespacesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NamespacesListResult); err != nil { + return NamespacesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the namespaces under an Azure subscription. +// +// Generated from API version 2023-06-01-preview +// - options - NamespacesClientListBySubscriptionOptions contains the optional parameters for the NamespacesClient.NewListBySubscriptionPager +// method. +func (client *NamespacesClient) NewListBySubscriptionPager(options *NamespacesClientListBySubscriptionOptions) *runtime.Pager[NamespacesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[NamespacesClientListBySubscriptionResponse]{ + More: func(page NamespacesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NamespacesClientListBySubscriptionResponse) (NamespacesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NamespacesClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespacesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespacesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *NamespacesClient) listBySubscriptionCreateRequest(ctx context.Context, options *NamespacesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/namespaces" + 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() + reqQP.Set("api-version", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *NamespacesClient) listBySubscriptionHandleResponse(resp *http.Response) (NamespacesClientListBySubscriptionResponse, error) { + result := NamespacesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NamespacesListResult); err != nil { + return NamespacesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// 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 2023-06-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 +// method. +func (client *NamespacesClient) ListSharedAccessKeys(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientListSharedAccessKeysOptions) (NamespacesClientListSharedAccessKeysResponse, error) { + req, err := client.listSharedAccessKeysCreateRequest(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return NamespacesClientListSharedAccessKeysResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespacesClientListSharedAccessKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespacesClientListSharedAccessKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listSharedAccessKeysHandleResponse(resp) +} + +// listSharedAccessKeysCreateRequest creates the ListSharedAccessKeys request. +func (client *NamespacesClient) listSharedAccessKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientListSharedAccessKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/listKeys" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSharedAccessKeysHandleResponse handles the ListSharedAccessKeys response. +func (client *NamespacesClient) listSharedAccessKeysHandleResponse(resp *http.Response) (NamespacesClientListSharedAccessKeysResponse, error) { + result := NamespacesClientListSharedAccessKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NamespaceSharedAccessKeys); err != nil { + return NamespacesClientListSharedAccessKeysResponse{}, err + } + return result, nil +} + +// BeginRegenerateKey - Regenerate a shared access key for a namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - NamespacesClientBeginRegenerateKeyOptions contains the optional parameters for the NamespacesClient.BeginRegenerateKey +// method. +func (client *NamespacesClient) BeginRegenerateKey(ctx context.Context, resourceGroupName string, namespaceName string, regenerateKeyRequest NamespaceRegenerateKeyRequest, options *NamespacesClientBeginRegenerateKeyOptions) (*runtime.Poller[NamespacesClientRegenerateKeyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.regenerateKey(ctx, resourceGroupName, namespaceName, regenerateKeyRequest, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespacesClientRegenerateKeyResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespacesClientRegenerateKeyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// RegenerateKey - Regenerate a shared access key for a namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespacesClient) regenerateKey(ctx context.Context, resourceGroupName string, namespaceName string, regenerateKeyRequest NamespaceRegenerateKeyRequest, options *NamespacesClientBeginRegenerateKeyOptions) (*http.Response, error) { + req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, namespaceName, regenerateKeyRequest, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// regenerateKeyCreateRequest creates the RegenerateKey request. +func (client *NamespacesClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, regenerateKeyRequest NamespaceRegenerateKeyRequest, options *NamespacesClientBeginRegenerateKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/regenerateKey" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) +} + +// BeginUpdate - Asynchronously updates a namespace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - namespaceUpdateParameters - Namespace update information. +// - options - NamespacesClientBeginUpdateOptions contains the optional parameters for the NamespacesClient.BeginUpdate method. +func (client *NamespacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, namespaceName string, namespaceUpdateParameters NamespaceUpdateParameters, options *NamespacesClientBeginUpdateOptions) (*runtime.Poller[NamespacesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, namespaceName, namespaceUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespacesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespacesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Asynchronously updates a namespace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespacesClient) update(ctx context.Context, resourceGroupName string, namespaceName string, namespaceUpdateParameters NamespaceUpdateParameters, options *NamespacesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, namespaceUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, namespaceUpdateParameters NamespaceUpdateParameters, options *NamespacesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, namespaceUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client.go new file mode 100644 index 000000000000..862824db5744 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopiceventsubscriptions_client.go @@ -0,0 +1,435 @@ +//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 + +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" +) + +// NamespaceTopicEventSubscriptionsClient contains the methods for the NamespaceTopicEventSubscriptions group. +// Don't use this type directly, use NewNamespaceTopicEventSubscriptionsClient() instead. +type NamespaceTopicEventSubscriptionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNamespaceTopicEventSubscriptionsClient creates a new instance of NamespaceTopicEventSubscriptionsClient 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 NewNamespaceTopicEventSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamespaceTopicEventSubscriptionsClient, error) { + cl, err := arm.NewClient(moduleName+".NamespaceTopicEventSubscriptionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NamespaceTopicEventSubscriptionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Asynchronously creates or updates an event subscription of a namespace topic with the specified parameters. +// Existing event subscriptions will be updated with this API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// - eventSubscriptionInfo - Event subscription properties containing the delivery mode, filter information, and others. +// - options - NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +func (client *NamespaceTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo Subscription, options *NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespaceTopicEventSubscriptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespaceTopicEventSubscriptionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespaceTopicEventSubscriptionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Asynchronously creates or updates an event subscription of a namespace topic with the specified parameters. +// Existing event subscriptions will be updated with this API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespaceTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo Subscription, options *NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NamespaceTopicEventSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo Subscription, options *NamespaceTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) +} + +// BeginDelete - Delete an existing event subscription of a namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// - options - NamespaceTopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.BeginDelete +// method. +func (client *NamespaceTopicEventSubscriptionsClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, options *NamespaceTopicEventSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[NamespaceTopicEventSubscriptionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, topicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespaceTopicEventSubscriptionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespaceTopicEventSubscriptionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete an existing event subscription of a namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespaceTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, options *NamespaceTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, topicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NamespaceTopicEventSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, options *NamespaceTopicEventSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 2023-06-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. +// - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// - options - NamespaceTopicEventSubscriptionsClientGetOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.Get +// method. +func (client *NamespaceTopicEventSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, options *NamespaceTopicEventSubscriptionsClientGetOptions) (NamespaceTopicEventSubscriptionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, topicName, eventSubscriptionName, options) + if err != nil { + return NamespaceTopicEventSubscriptionsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespaceTopicEventSubscriptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespaceTopicEventSubscriptionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NamespaceTopicEventSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, options *NamespaceTopicEventSubscriptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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", "2023-06-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 *NamespaceTopicEventSubscriptionsClient) getHandleResponse(resp *http.Response) (NamespaceTopicEventSubscriptionsClientGetResponse, error) { + result := NamespaceTopicEventSubscriptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Subscription); err != nil { + return NamespaceTopicEventSubscriptionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespaceTopicPager - List event subscriptions that belong to a specific namespace topic. +// +// Generated from API version 2023-06-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. +// - options - NamespaceTopicEventSubscriptionsClientListByNamespaceTopicOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.NewListByNamespaceTopicPager +// method. +func (client *NamespaceTopicEventSubscriptionsClient) NewListByNamespaceTopicPager(resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicEventSubscriptionsClientListByNamespaceTopicOptions) *runtime.Pager[NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse] { + return runtime.NewPager(runtime.PagingHandler[NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse]{ + More: func(page NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse) (NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceTopicCreateRequest(ctx, resourceGroupName, namespaceName, topicName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceTopicHandleResponse(resp) + }, + }) +} + +// listByNamespaceTopicCreateRequest creates the ListByNamespaceTopic request. +func (client *NamespaceTopicEventSubscriptionsClient) listByNamespaceTopicCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicEventSubscriptionsClientListByNamespaceTopicOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}/eventSubscriptions" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + 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", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceTopicHandleResponse handles the ListByNamespaceTopic response. +func (client *NamespaceTopicEventSubscriptionsClient) listByNamespaceTopicHandleResponse(resp *http.Response) (NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse, error) { + result := NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SubscriptionsListResult); err != nil { + return NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update an existing event subscription of a namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// - eventSubscriptionUpdateParameters - Updated event subscription information. +// - options - NamespaceTopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the NamespaceTopicEventSubscriptionsClient.BeginUpdate +// method. +func (client *NamespaceTopicEventSubscriptionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters SubscriptionUpdateParameters, options *NamespaceTopicEventSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[NamespaceTopicEventSubscriptionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, namespaceName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespaceTopicEventSubscriptionsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespaceTopicEventSubscriptionsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update an existing event subscription of a namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespaceTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters SubscriptionUpdateParameters, options *NamespaceTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NamespaceTopicEventSubscriptionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters SubscriptionUpdateParameters, options *NamespaceTopicEventSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client.go new file mode 100644 index 000000000000..8c974ea819f7 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/namespacetopics_client.go @@ -0,0 +1,539 @@ +//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 + +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" +) + +// NamespaceTopicsClient contains the methods for the NamespaceTopics group. +// Don't use this type directly, use NewNamespaceTopicsClient() instead. +type NamespaceTopicsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNamespaceTopicsClient creates a new instance of NamespaceTopicsClient 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 NewNamespaceTopicsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamespaceTopicsClient, error) { + cl, err := arm.NewClient(moduleName+".NamespaceTopicsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NamespaceTopicsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2023-06-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. +// - namespaceTopicInfo - Namespace topic information. +// - options - NamespaceTopicsClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespaceTopicsClient.BeginCreateOrUpdate +// method. +func (client *NamespaceTopicsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicInfo NamespaceTopic, options *NamespaceTopicsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamespaceTopicsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, topicName, namespaceTopicInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespaceTopicsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespaceTopicsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 2023-06-01-preview +func (client *NamespaceTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicInfo NamespaceTopic, options *NamespaceTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, topicName, namespaceTopicInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NamespaceTopicsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicInfo NamespaceTopic, options *NamespaceTopicsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, namespaceTopicInfo) +} + +// BeginDelete - Delete existing namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - topicName - Name of the topic. +// - options - NamespaceTopicsClientBeginDeleteOptions contains the optional parameters for the NamespaceTopicsClient.BeginDelete +// method. +func (client *NamespaceTopicsClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientBeginDeleteOptions) (*runtime.Poller[NamespaceTopicsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, topicName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespaceTopicsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespaceTopicsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete existing namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespaceTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, topicName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *NamespaceTopicsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - NamespaceTopicsClientGetOptions contains the optional parameters for the NamespaceTopicsClient.Get method. +func (client *NamespaceTopicsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientGetOptions) (NamespaceTopicsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, topicName, options) + if err != nil { + return NamespaceTopicsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespaceTopicsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespaceTopicsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *NamespaceTopicsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + 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", "2023-06-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 *NamespaceTopicsClient) getHandleResponse(resp *http.Response) (NamespaceTopicsClientGetResponse, error) { + result := NamespaceTopicsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NamespaceTopic); err != nil { + return NamespaceTopicsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespacePager - List all the namespace topics under a namespace. +// +// Generated from API version 2023-06-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 +// method. +func (client *NamespaceTopicsClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *NamespaceTopicsClientListByNamespaceOptions) *runtime.Pager[NamespaceTopicsClientListByNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[NamespaceTopicsClientListByNamespaceResponse]{ + More: func(page NamespaceTopicsClientListByNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NamespaceTopicsClientListByNamespaceResponse) (NamespaceTopicsClientListByNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return NamespaceTopicsClientListByNamespaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespaceTopicsClientListByNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespaceTopicsClientListByNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceHandleResponse(resp) + }, + }) +} + +// listByNamespaceCreateRequest creates the ListByNamespace request. +func (client *NamespaceTopicsClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespaceTopicsClientListByNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceHandleResponse handles the ListByNamespace response. +func (client *NamespaceTopicsClient) listByNamespaceHandleResponse(resp *http.Response) (NamespaceTopicsClientListByNamespaceResponse, error) { + result := NamespaceTopicsClientListByNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NamespaceTopicsListResult); err != nil { + return NamespaceTopicsClientListByNamespaceResponse{}, err + } + return result, nil +} + +// 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 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - topicName - Name of the topic. +// - options - NamespaceTopicsClientListSharedAccessKeysOptions contains the optional parameters for the NamespaceTopicsClient.ListSharedAccessKeys +// method. +func (client *NamespaceTopicsClient) ListSharedAccessKeys(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientListSharedAccessKeysOptions) (NamespaceTopicsClientListSharedAccessKeysResponse, error) { + req, err := client.listSharedAccessKeysCreateRequest(ctx, resourceGroupName, namespaceName, topicName, options) + if err != nil { + return NamespaceTopicsClientListSharedAccessKeysResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NamespaceTopicsClientListSharedAccessKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NamespaceTopicsClientListSharedAccessKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listSharedAccessKeysHandleResponse(resp) +} + +// listSharedAccessKeysCreateRequest creates the ListSharedAccessKeys request. +func (client *NamespaceTopicsClient) listSharedAccessKeysCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, options *NamespaceTopicsClientListSharedAccessKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}/listKeys" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSharedAccessKeysHandleResponse handles the ListSharedAccessKeys response. +func (client *NamespaceTopicsClient) listSharedAccessKeysHandleResponse(resp *http.Response) (NamespaceTopicsClientListSharedAccessKeysResponse, error) { + result := NamespaceTopicsClientListSharedAccessKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TopicSharedAccessKeys); err != nil { + return NamespaceTopicsClientListSharedAccessKeysResponse{}, err + } + return result, nil +} + +// BeginRegenerateKey - Regenerate a shared access key for a namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - topicName - Name of the topic. +// - regenerateKeyRequest - Request body to regenerate key. +// - options - NamespaceTopicsClientBeginRegenerateKeyOptions contains the optional parameters for the NamespaceTopicsClient.BeginRegenerateKey +// method. +func (client *NamespaceTopicsClient) BeginRegenerateKey(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest, options *NamespaceTopicsClientBeginRegenerateKeyOptions) (*runtime.Poller[NamespaceTopicsClientRegenerateKeyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.regenerateKey(ctx, resourceGroupName, namespaceName, topicName, regenerateKeyRequest, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespaceTopicsClientRegenerateKeyResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespaceTopicsClientRegenerateKeyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// RegenerateKey - Regenerate a shared access key for a namespace topic. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespaceTopicsClient) regenerateKey(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest, options *NamespaceTopicsClientBeginRegenerateKeyOptions) (*http.Response, error) { + req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, namespaceName, topicName, regenerateKeyRequest, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// regenerateKeyCreateRequest creates the RegenerateKey request. +func (client *NamespaceTopicsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest, options *NamespaceTopicsClientBeginRegenerateKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}/regenerateKey" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) +} + +// BeginUpdate - Asynchronously updates a namespace topic with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - namespaceTopicUpdateParameters - Namespace topic update information. +// - options - NamespaceTopicsClientBeginUpdateOptions contains the optional parameters for the NamespaceTopicsClient.BeginUpdate +// method. +func (client *NamespaceTopicsClient) BeginUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicUpdateParameters NamespaceTopicUpdateParameters, options *NamespaceTopicsClientBeginUpdateOptions) (*runtime.Poller[NamespaceTopicsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, namespaceName, topicName, namespaceTopicUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamespaceTopicsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespaceTopicsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Asynchronously updates a namespace topic with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *NamespaceTopicsClient) update(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicUpdateParameters NamespaceTopicUpdateParameters, options *NamespaceTopicsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, namespaceName, topicName, namespaceTopicUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *NamespaceTopicsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, namespaceTopicUpdateParameters NamespaceTopicUpdateParameters, options *NamespaceTopicsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topics/{topicName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, namespaceTopicUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go index 22c13003e166..6fa8f0b4b3d3 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/operations_client.go @@ -40,7 +40,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 2022-06-15 +// Generated from API version 2023-06-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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-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 0eadeca9ba7e..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/partnerconfigurations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client.go index a8c1e8b5d2ee..fdb3161874db 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnerconfigurations_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -85,7 +85,7 @@ func (client *PartnerConfigurationsClient) authorizePartnerCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerInfo) @@ -103,7 +103,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -123,7 +123,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerConfigurationInfo PartnerConfiguration, options *PartnerConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerConfigurationInfo, options) if err != nil { @@ -155,7 +155,7 @@ func (client *PartnerConfigurationsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerConfigurationInfo) @@ -164,7 +164,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -183,7 +183,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, options) if err != nil { @@ -215,7 +215,7 @@ func (client *PartnerConfigurationsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -223,7 +223,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -258,7 +258,7 @@ func (client *PartnerConfigurationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,7 +275,7 @@ func (client *PartnerConfigurationsClient) getHandleResponse(resp *http.Response // NewListByResourceGroupPager - List all the partner configurations under a resource group. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -317,7 +317,7 @@ func (client *PartnerConfigurationsClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +334,7 @@ func (client *PartnerConfigurationsClient) listByResourceGroupHandleResponse(res // NewListBySubscriptionPager - List all the partner configurations under an Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - PartnerConfigurationsClientListBySubscriptionOptions contains the optional parameters for the PartnerConfigurationsClient.NewListBySubscriptionPager // method. func (client *PartnerConfigurationsClient) NewListBySubscriptionPager(options *PartnerConfigurationsClientListBySubscriptionOptions) *runtime.Pager[PartnerConfigurationsClientListBySubscriptionResponse] { @@ -377,7 +377,7 @@ func (client *PartnerConfigurationsClient) listBySubscriptionCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -401,7 +401,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -437,7 +437,7 @@ func (client *PartnerConfigurationsClient) unauthorizePartnerCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerInfo) @@ -455,7 +455,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -475,7 +475,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerConfigurationsClient) update(ctx context.Context, resourceGroupName string, partnerConfigurationUpdateParameters PartnerConfigurationUpdateParameters, options *PartnerConfigurationsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerConfigurationUpdateParameters, options) if err != nil { @@ -507,7 +507,7 @@ func (client *PartnerConfigurationsClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerConfigurationUpdateParameters) 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 60d8dd83272d..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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..f008d8f37c82 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnerdestinations_client.go @@ -0,0 +1,502 @@ +//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 + +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+".PartnerDestinationsClient", 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 2023-06-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) { + req, err := client.activateCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientActivateResponse{}, runtime.NewResponseError(resp) + } + return client.activateHandleResponse(resp) +} + +// activateCreateRequest creates the Activate request. +func (client *PartnerDestinationsClient) activateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *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", "2023-06-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 2023-06-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PartnerDestinationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PartnerDestinationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 2023-06-01-preview +func (client *PartnerDestinationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination PartnerDestination, options *PartnerDestinationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerDestinationName, partnerDestination, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerDestinationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination PartnerDestination, options *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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerDestination) +} + +// BeginDelete - Delete existing partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PartnerDestinationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PartnerDestinationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete existing partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *PartnerDestinationsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerDestinationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *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", "2023-06-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 2023-06-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) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PartnerDestinationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *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", "2023-06-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 2023-06-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) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerDestinationsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PartnerDestinationsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// 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() + reqQP.Set("api-version", "2023-06-01-preview") + 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)) + } + 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 2023-06-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) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerDestinationsClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PartnerDestinationsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// 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() + reqQP.Set("api-version", "2023-06-01-preview") + 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)) + } + 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 2023-06-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 + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PartnerDestinationsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PartnerDestinationsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Asynchronously updates a partner destination with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *PartnerDestinationsClient) update(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters PartnerDestinationUpdateParameters, options *PartnerDestinationsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerDestinationName, partnerDestinationUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PartnerDestinationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters PartnerDestinationUpdateParameters, options *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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerDestinationUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go index 7d6febb62e77..25de7cac473a 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnernamespaces_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerNamespaceName - Name of the partner namespace. // - partnerNamespaceInfo - PartnerNamespace information. @@ -70,7 +70,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerNamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceInfo PartnerNamespace, options *PartnerNamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerNamespaceName, partnerNamespaceInfo, options) if err != nil { @@ -106,7 +106,7 @@ func (client *PartnerNamespacesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerNamespaceInfo) @@ -115,7 +115,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -135,7 +135,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerNamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerNamespaceName, options) if err != nil { @@ -171,7 +171,7 @@ func (client *PartnerNamespacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -179,7 +179,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -218,7 +218,7 @@ func (client *PartnerNamespacesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *PartnerNamespacesClient) getHandleResponse(resp *http.Response) (P // NewListByResourceGroupPager - List all the partner namespaces under a resource group. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -283,7 +283,7 @@ func (client *PartnerNamespacesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -306,7 +306,7 @@ func (client *PartnerNamespacesClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List all the partner namespaces under an Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - PartnerNamespacesClientListBySubscriptionOptions contains the optional parameters for the PartnerNamespacesClient.NewListBySubscriptionPager // method. func (client *PartnerNamespacesClient) NewListBySubscriptionPager(options *PartnerNamespacesClientListBySubscriptionOptions) *runtime.Pager[PartnerNamespacesClientListBySubscriptionResponse] { @@ -349,7 +349,7 @@ func (client *PartnerNamespacesClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -373,7 +373,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -413,7 +413,7 @@ func (client *PartnerNamespacesClient) listSharedAccessKeysCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,7 +431,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -472,7 +472,7 @@ func (client *PartnerNamespacesClient) regenerateKeyCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) @@ -490,7 +490,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -511,7 +511,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerNamespacesClient) update(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceUpdateParameters PartnerNamespaceUpdateParameters, options *PartnerNamespacesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters, options) if err != nil { @@ -547,7 +547,7 @@ func (client *PartnerNamespacesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerNamespaceUpdateParameters) 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 e1f674183c88..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 3b17b4a1a28f..5377204b0598 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnerregistrations_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerRegistrationName - Name of the partner registration. // - partnerRegistrationInfo - PartnerRegistration information. @@ -70,7 +70,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerRegistrationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationInfo PartnerRegistration, options *PartnerRegistrationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerRegistrationName, partnerRegistrationInfo, options) if err != nil { @@ -106,7 +106,7 @@ func (client *PartnerRegistrationsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerRegistrationInfo) @@ -115,7 +115,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -135,7 +135,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerRegistrationsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerRegistrationName string, options *PartnerRegistrationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerRegistrationName, options) if err != nil { @@ -171,7 +171,7 @@ func (client *PartnerRegistrationsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -179,7 +179,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -219,7 +219,7 @@ func (client *PartnerRegistrationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +236,7 @@ func (client *PartnerRegistrationsClient) getHandleResponse(resp *http.Response) // NewListByResourceGroupPager - List all the partner registrations under a resource group. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -284,7 +284,7 @@ func (client *PartnerRegistrationsClient) listByResourceGroupCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -307,7 +307,7 @@ func (client *PartnerRegistrationsClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - List all the partner registrations under an Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - PartnerRegistrationsClientListBySubscriptionOptions contains the optional parameters for the PartnerRegistrationsClient.NewListBySubscriptionPager // method. func (client *PartnerRegistrationsClient) NewListBySubscriptionPager(options *PartnerRegistrationsClientListBySubscriptionOptions) *runtime.Pager[PartnerRegistrationsClientListBySubscriptionResponse] { @@ -350,7 +350,7 @@ func (client *PartnerRegistrationsClient) listBySubscriptionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -374,7 +374,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -395,7 +395,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerRegistrationsClient) update(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationUpdateParameters PartnerRegistrationUpdateParameters, options *PartnerRegistrationsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerRegistrationName, partnerRegistrationUpdateParameters, options) if err != nil { @@ -431,7 +431,7 @@ func (client *PartnerRegistrationsClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerRegistrationUpdateParameters) 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 24f2b303c01e..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 59709ac0bfe2..802072affd35 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopiceventsubscriptions_client.go @@ -50,7 +50,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -74,7 +74,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -114,7 +114,7 @@ func (client *PartnerTopicEventSubscriptionsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) @@ -123,7 +123,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -145,7 +145,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *PartnerTopicEventSubscriptionsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -193,7 +193,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 2022-06-15 +// Generated from API version 2023-06-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. Event subscription names must be between 3 and 100 @@ -239,7 +239,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +257,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -303,7 +303,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getDeliveryAttributesCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -367,7 +367,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +384,7 @@ func (client *PartnerTopicEventSubscriptionsClient) getFullURLHandleResponse(res // NewListByPartnerTopicPager - List event subscriptions that belong to a specific partner topic. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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 @@ -437,7 +437,7 @@ func (client *PartnerTopicEventSubscriptionsClient) listByPartnerTopicCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -461,7 +461,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -484,7 +484,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *PartnerTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -524,7 +524,7 @@ func (client *PartnerTopicEventSubscriptionsClient) updateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) 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 2723e1c249b9..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 8b5ebc111948..a3b9502ee296 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/partnertopics_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -88,7 +88,7 @@ func (client *PartnerTopicsClient) activateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - partnerTopicInfo - Partner Topic information. @@ -147,7 +147,7 @@ func (client *PartnerTopicsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerTopicInfo) @@ -165,7 +165,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -205,7 +205,7 @@ func (client *PartnerTopicsClient) deactivateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,7 +223,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -243,7 +243,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PartnerTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerTopicName, options) if err != nil { @@ -279,7 +279,7 @@ func (client *PartnerTopicsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -287,7 +287,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -326,7 +326,7 @@ func (client *PartnerTopicsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,7 +343,7 @@ func (client *PartnerTopicsClient) getHandleResponse(resp *http.Response) (Partn // NewListByResourceGroupPager - List all the partner topics under a resource group. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -391,7 +391,7 @@ func (client *PartnerTopicsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -414,7 +414,7 @@ func (client *PartnerTopicsClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - List all the partner topics under an Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - PartnerTopicsClientListBySubscriptionOptions contains the optional parameters for the PartnerTopicsClient.NewListBySubscriptionPager // method. func (client *PartnerTopicsClient) NewListBySubscriptionPager(options *PartnerTopicsClientListBySubscriptionOptions) *runtime.Pager[PartnerTopicsClientListBySubscriptionResponse] { @@ -457,7 +457,7 @@ func (client *PartnerTopicsClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -481,7 +481,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - partnerTopicName - Name of the partner topic. // - partnerTopicUpdateParameters - PartnerTopic update information. @@ -521,7 +521,7 @@ func (client *PartnerTopicsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, partnerTopicUpdateParameters) 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 1dfa46214b39..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 new file mode 100644 index 000000000000..2bb17aa1d5af --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/permissionbindings_client.go @@ -0,0 +1,330 @@ +//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 + +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" +) + +// PermissionBindingsClient contains the methods for the PermissionBindings group. +// Don't use this type directly, use NewPermissionBindingsClient() instead. +type PermissionBindingsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPermissionBindingsClient creates a new instance of PermissionBindingsClient 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 NewPermissionBindingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PermissionBindingsClient, error) { + cl, err := arm.NewClient(moduleName+".PermissionBindingsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PermissionBindingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - permissionBindingName - The permission binding name. +// - permissionBindingInfo - Permission binding information. +// - options - PermissionBindingsClientBeginCreateOrUpdateOptions contains the optional parameters for the PermissionBindingsClient.BeginCreateOrUpdate +// method. +func (client *PermissionBindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, permissionBindingInfo PermissionBinding, options *PermissionBindingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PermissionBindingsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, permissionBindingName, permissionBindingInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PermissionBindingsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PermissionBindingsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 2023-06-01-preview +func (client *PermissionBindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, permissionBindingInfo PermissionBinding, options *PermissionBindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, permissionBindingName, permissionBindingInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PermissionBindingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, permissionBindingInfo PermissionBinding, options *PermissionBindingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/permissionBindings/{permissionBindingName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if permissionBindingName == "" { + return nil, errors.New("parameter permissionBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{permissionBindingName}", url.PathEscape(permissionBindingName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, permissionBindingInfo) +} + +// BeginDelete - Delete an existing permission binding. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - PermissionBindingsClientBeginDeleteOptions contains the optional parameters for the PermissionBindingsClient.BeginDelete +// method. +func (client *PermissionBindingsClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, options *PermissionBindingsClientBeginDeleteOptions) (*runtime.Poller[PermissionBindingsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, permissionBindingName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PermissionBindingsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PermissionBindingsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete an existing permission binding. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *PermissionBindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, options *PermissionBindingsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, permissionBindingName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PermissionBindingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, options *PermissionBindingsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/permissionBindings/{permissionBindingName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if permissionBindingName == "" { + return nil, errors.New("parameter permissionBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{permissionBindingName}", url.PathEscape(permissionBindingName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a permission binding. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - PermissionBindingsClientGetOptions contains the optional parameters for the PermissionBindingsClient.Get method. +func (client *PermissionBindingsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, options *PermissionBindingsClientGetOptions) (PermissionBindingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, permissionBindingName, options) + if err != nil { + return PermissionBindingsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PermissionBindingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PermissionBindingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PermissionBindingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, permissionBindingName string, options *PermissionBindingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/permissionBindings/{permissionBindingName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if permissionBindingName == "" { + return nil, errors.New("parameter permissionBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{permissionBindingName}", url.PathEscape(permissionBindingName)) + 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", "2023-06-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 *PermissionBindingsClient) getHandleResponse(resp *http.Response) (PermissionBindingsClientGetResponse, error) { + result := PermissionBindingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PermissionBinding); err != nil { + return PermissionBindingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespacePager - Get all the permission bindings under a namespace. +// +// Generated from API version 2023-06-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 +// method. +func (client *PermissionBindingsClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *PermissionBindingsClientListByNamespaceOptions) *runtime.Pager[PermissionBindingsClientListByNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[PermissionBindingsClientListByNamespaceResponse]{ + More: func(page PermissionBindingsClientListByNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PermissionBindingsClientListByNamespaceResponse) (PermissionBindingsClientListByNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PermissionBindingsClientListByNamespaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PermissionBindingsClientListByNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PermissionBindingsClientListByNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceHandleResponse(resp) + }, + }) +} + +// listByNamespaceCreateRequest creates the ListByNamespace request. +func (client *PermissionBindingsClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *PermissionBindingsClientListByNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/permissionBindings" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceHandleResponse handles the ListByNamespace response. +func (client *PermissionBindingsClient) listByNamespaceHandleResponse(resp *http.Response) (PermissionBindingsClientListByNamespaceResponse, error) { + result := PermissionBindingsClientListByNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PermissionBindingsListResult); err != nil { + return PermissionBindingsClientListByNamespaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go b/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go index c2e82eadf762..7e5a9c17f4e9 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/polymorphic_helpers.go @@ -157,6 +157,8 @@ func unmarshalEventSubscriptionDestinationClassification(rawMsg json.RawMessage) b = &EventHubEventSubscriptionDestination{} case string(EndpointTypeHybridConnection): b = &HybridConnectionEventSubscriptionDestination{} + case string(EndpointTypePartnerDestination): + b = &PartnerEventSubscriptionDestination{} case string(EndpointTypeServiceBusQueue): b = &ServiceBusQueueEventSubscriptionDestination{} case string(EndpointTypeServiceBusTopic): @@ -171,6 +173,79 @@ func unmarshalEventSubscriptionDestinationClassification(rawMsg json.RawMessage) return b, json.Unmarshal(rawMsg, b) } +func unmarshalFilterClassification(rawMsg json.RawMessage) (FilterClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b FilterClassification + switch m["operatorType"] { + case string(FilterOperatorTypeBoolEquals): + b = &BoolEqualsFilter{} + case string(FilterOperatorTypeIsNotNull): + b = &IsNotNullFilter{} + case string(FilterOperatorTypeIsNullOrUndefined): + b = &IsNullOrUndefinedFilter{} + case string(FilterOperatorTypeNumberGreaterThan): + b = &NumberGreaterThanFilter{} + case string(FilterOperatorTypeNumberGreaterThanOrEquals): + b = &NumberGreaterThanOrEqualsFilter{} + case string(FilterOperatorTypeNumberIn): + b = &NumberInFilter{} + case string(FilterOperatorTypeNumberInRange): + b = &NumberInRangeFilter{} + case string(FilterOperatorTypeNumberLessThan): + b = &NumberLessThanFilter{} + case string(FilterOperatorTypeNumberLessThanOrEquals): + b = &NumberLessThanOrEqualsFilter{} + case string(FilterOperatorTypeNumberNotIn): + b = &NumberNotInFilter{} + case string(FilterOperatorTypeNumberNotInRange): + b = &NumberNotInRangeFilter{} + case string(FilterOperatorTypeStringBeginsWith): + b = &StringBeginsWithFilter{} + case string(FilterOperatorTypeStringContains): + b = &StringContainsFilter{} + case string(FilterOperatorTypeStringEndsWith): + b = &StringEndsWithFilter{} + case string(FilterOperatorTypeStringIn): + b = &StringInFilter{} + case string(FilterOperatorTypeStringNotBeginsWith): + b = &StringNotBeginsWithFilter{} + case string(FilterOperatorTypeStringNotContains): + b = &StringNotContainsFilter{} + case string(FilterOperatorTypeStringNotEndsWith): + b = &StringNotEndsWithFilter{} + case string(FilterOperatorTypeStringNotIn): + b = &StringNotInFilter{} + default: + b = &Filter{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalFilterClassificationArray(rawMsg json.RawMessage) ([]FilterClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]FilterClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalFilterClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + func unmarshalInputSchemaMappingClassification(rawMsg json.RawMessage) (InputSchemaMappingClassification, error) { if rawMsg == nil { return nil, nil @@ -188,3 +263,57 @@ func unmarshalInputSchemaMappingClassification(rawMsg json.RawMessage) (InputSch } return b, json.Unmarshal(rawMsg, b) } + +func unmarshalPartnerClientAuthenticationClassification(rawMsg json.RawMessage) (PartnerClientAuthenticationClassification, error) { + if rawMsg == nil { + 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{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalPartnerDestinationInfoClassification(rawMsg json.RawMessage) (PartnerDestinationInfoClassification, error) { + if rawMsg == nil { + 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{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalPartnerUpdateDestinationInfoClassification(rawMsg json.RawMessage) (PartnerUpdateDestinationInfoClassification, error) { + if rawMsg == nil { + 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{} + } + return b, json.Unmarshal(rawMsg, b) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go index cb7ca217901f..bb5870097b9c 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/privateendpointconnections_client.go @@ -46,13 +46,14 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor return client, nil } -// BeginDelete - Delete a specific private endpoint connection under a topic, domain, or partner namespace. +// 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 2022-06-15 +// Generated from API version 2023-06-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\'. -// - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). +// - 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 +// namespace name). // - privateEndpointConnectionName - The name of the private endpoint connection connection. // - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. @@ -68,10 +69,10 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, } } -// Delete - Delete a specific private endpoint connection under a topic, domain, or partner namespace. +// 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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, parentType, parentName, privateEndpointConnectionName, options) if err != nil { @@ -115,18 +116,19 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } -// Get - Get a specific private endpoint connection under a topic, domain, or partner namespace. +// 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 2022-06-15 +// Generated from API version 2023-06-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\'. -// - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). +// - 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 +// namespace name). // - privateEndpointConnectionName - The name of the private endpoint connection connection. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. @@ -173,7 +175,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,12 +190,13 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res return result, nil } -// NewListByResourcePager - Get all private endpoint connections under a topic, domain, or partner namespace. +// NewListByResourcePager - Get all private endpoint connections under a topic, domain, or partner namespace or namespace. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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\'. -// - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). +// - 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 +// namespace name). // - options - PrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByResourcePager // method. func (client *PrivateEndpointConnectionsClient) NewListByResourcePager(resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, options *PrivateEndpointConnectionsClientListByResourceOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByResourceResponse] { @@ -248,7 +251,7 @@ func (client *PrivateEndpointConnectionsClient) listByResourceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -272,10 +275,11 @@ 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 2022-06-15 +// Generated from API version 2023-06-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\'. -// - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). +// - 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 +// namespace name). // - privateEndpointConnectionName - The name of the private endpoint connection connection. // - privateEndpointConnection - The private endpoint connection object to update. // - options - PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate @@ -295,7 +299,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, options) if err != nil { @@ -339,7 +343,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateEndpointConnection) 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 972dd1f8225c..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 b38266e30ae0..5eb83cc33f63 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/privatelinkresources_client.go @@ -49,11 +49,12 @@ 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 2022-06-15 +// Generated from API version 2023-06-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\'. -// - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). -// - privateLinkResourceName - The name of private link resource. +// - 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 +// namespace name). +// - privateLinkResourceName - The name of private link resource will be either topic, domain, partnerNamespace or namespace. // - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get // method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, parentType string, parentName string, privateLinkResourceName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { @@ -99,7 +100,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,12 +115,13 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByResourcePager - List all the private link resources under a topic, domain, or partner namespace. +// NewListByResourcePager - List all the private link resources under a topic, domain, or partner namespace or namespace. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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\'. -// - parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). +// - 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 +// name). // - options - PrivateLinkResourcesClientListByResourceOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByResourcePager // method. func (client *PrivateLinkResourcesClient) NewListByResourcePager(resourceGroupName string, parentType string, parentName string, options *PrivateLinkResourcesClientListByResourceOptions) *runtime.Pager[PrivateLinkResourcesClientListByResourceResponse] { @@ -174,7 +176,7 @@ func (client *PrivateLinkResourcesClient) listByResourceCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } 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 fbb52424b132..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/response_types.go b/sdk/resourcemanager/eventgrid/armeventgrid/response_types.go index fd32beb77fc9..59d8330ca688 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/response_types.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/response_types.go @@ -9,6 +9,26 @@ package armeventgrid +// CaCertificatesClientCreateOrUpdateResponse contains the response from method CaCertificatesClient.BeginCreateOrUpdate. +type CaCertificatesClientCreateOrUpdateResponse struct { + CaCertificate +} + +// CaCertificatesClientDeleteResponse contains the response from method CaCertificatesClient.BeginDelete. +type CaCertificatesClientDeleteResponse struct { + // placeholder for future response values +} + +// CaCertificatesClientGetResponse contains the response from method CaCertificatesClient.Get. +type CaCertificatesClientGetResponse struct { + CaCertificate +} + +// CaCertificatesClientListByNamespaceResponse contains the response from method CaCertificatesClient.NewListByNamespacePager. +type CaCertificatesClientListByNamespaceResponse struct { + CaCertificatesListResult +} + // ChannelsClientCreateOrUpdateResponse contains the response from method ChannelsClient.CreateOrUpdate. type ChannelsClientCreateOrUpdateResponse struct { Channel @@ -39,6 +59,46 @@ type ChannelsClientUpdateResponse struct { // placeholder for future response values } +// ClientGroupsClientCreateOrUpdateResponse contains the response from method ClientGroupsClient.BeginCreateOrUpdate. +type ClientGroupsClientCreateOrUpdateResponse struct { + ClientGroup +} + +// ClientGroupsClientDeleteResponse contains the response from method ClientGroupsClient.BeginDelete. +type ClientGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// ClientGroupsClientGetResponse contains the response from method ClientGroupsClient.Get. +type ClientGroupsClientGetResponse struct { + ClientGroup +} + +// ClientGroupsClientListByNamespaceResponse contains the response from method ClientGroupsClient.NewListByNamespacePager. +type ClientGroupsClientListByNamespaceResponse struct { + ClientGroupsListResult +} + +// ClientsClientCreateOrUpdateResponse contains the response from method ClientsClient.BeginCreateOrUpdate. +type ClientsClientCreateOrUpdateResponse struct { + Client +} + +// ClientsClientDeleteResponse contains the response from method ClientsClient.BeginDelete. +type ClientsClientDeleteResponse struct { + // placeholder for future response values +} + +// ClientsClientGetResponse contains the response from method ClientsClient.Get. +type ClientsClientGetResponse struct { + Client +} + +// ClientsClientListByNamespaceResponse contains the response from method ClientsClient.NewListByNamespacePager. +type ClientsClientListByNamespaceResponse struct { + ClientsListResult +} + // DomainEventSubscriptionsClientCreateOrUpdateResponse contains the response from method DomainEventSubscriptionsClient.BeginCreateOrUpdate. type DomainEventSubscriptionsClientCreateOrUpdateResponse struct { EventSubscription @@ -254,6 +314,106 @@ type ExtensionTopicsClientGetResponse struct { ExtensionTopic } +// NamespaceTopicEventSubscriptionsClientCreateOrUpdateResponse contains the response from method NamespaceTopicEventSubscriptionsClient.BeginCreateOrUpdate. +type NamespaceTopicEventSubscriptionsClientCreateOrUpdateResponse struct { + Subscription +} + +// NamespaceTopicEventSubscriptionsClientDeleteResponse contains the response from method NamespaceTopicEventSubscriptionsClient.BeginDelete. +type NamespaceTopicEventSubscriptionsClientDeleteResponse struct { + // placeholder for future response values +} + +// NamespaceTopicEventSubscriptionsClientGetResponse contains the response from method NamespaceTopicEventSubscriptionsClient.Get. +type NamespaceTopicEventSubscriptionsClientGetResponse struct { + Subscription +} + +// NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse contains the response from method NamespaceTopicEventSubscriptionsClient.NewListByNamespaceTopicPager. +type NamespaceTopicEventSubscriptionsClientListByNamespaceTopicResponse struct { + SubscriptionsListResult +} + +// NamespaceTopicEventSubscriptionsClientUpdateResponse contains the response from method NamespaceTopicEventSubscriptionsClient.BeginUpdate. +type NamespaceTopicEventSubscriptionsClientUpdateResponse struct { + Subscription +} + +// NamespaceTopicsClientCreateOrUpdateResponse contains the response from method NamespaceTopicsClient.BeginCreateOrUpdate. +type NamespaceTopicsClientCreateOrUpdateResponse struct { + NamespaceTopic +} + +// NamespaceTopicsClientDeleteResponse contains the response from method NamespaceTopicsClient.BeginDelete. +type NamespaceTopicsClientDeleteResponse struct { + // placeholder for future response values +} + +// NamespaceTopicsClientGetResponse contains the response from method NamespaceTopicsClient.Get. +type NamespaceTopicsClientGetResponse struct { + NamespaceTopic +} + +// NamespaceTopicsClientListByNamespaceResponse contains the response from method NamespaceTopicsClient.NewListByNamespacePager. +type NamespaceTopicsClientListByNamespaceResponse struct { + NamespaceTopicsListResult +} + +// NamespaceTopicsClientListSharedAccessKeysResponse contains the response from method NamespaceTopicsClient.ListSharedAccessKeys. +type NamespaceTopicsClientListSharedAccessKeysResponse struct { + TopicSharedAccessKeys +} + +// NamespaceTopicsClientRegenerateKeyResponse contains the response from method NamespaceTopicsClient.BeginRegenerateKey. +type NamespaceTopicsClientRegenerateKeyResponse struct { + TopicSharedAccessKeys +} + +// NamespaceTopicsClientUpdateResponse contains the response from method NamespaceTopicsClient.BeginUpdate. +type NamespaceTopicsClientUpdateResponse struct { + NamespaceTopic +} + +// NamespacesClientCreateOrUpdateResponse contains the response from method NamespacesClient.BeginCreateOrUpdate. +type NamespacesClientCreateOrUpdateResponse struct { + Namespace +} + +// NamespacesClientDeleteResponse contains the response from method NamespacesClient.BeginDelete. +type NamespacesClientDeleteResponse struct { + // placeholder for future response values +} + +// NamespacesClientGetResponse contains the response from method NamespacesClient.Get. +type NamespacesClientGetResponse struct { + Namespace +} + +// NamespacesClientListByResourceGroupResponse contains the response from method NamespacesClient.NewListByResourceGroupPager. +type NamespacesClientListByResourceGroupResponse struct { + NamespacesListResult +} + +// NamespacesClientListBySubscriptionResponse contains the response from method NamespacesClient.NewListBySubscriptionPager. +type NamespacesClientListBySubscriptionResponse struct { + NamespacesListResult +} + +// NamespacesClientListSharedAccessKeysResponse contains the response from method NamespacesClient.ListSharedAccessKeys. +type NamespacesClientListSharedAccessKeysResponse struct { + NamespaceSharedAccessKeys +} + +// NamespacesClientRegenerateKeyResponse contains the response from method NamespacesClient.BeginRegenerateKey. +type NamespacesClientRegenerateKeyResponse struct { + NamespaceSharedAccessKeys +} + +// NamespacesClientUpdateResponse contains the response from method NamespacesClient.BeginUpdate. +type NamespacesClientUpdateResponse struct { + Namespace +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationsListResult @@ -299,6 +459,41 @@ type PartnerConfigurationsClientUpdateResponse struct { PartnerConfiguration } +// PartnerDestinationsClientActivateResponse contains the response from method PartnerDestinationsClient.Activate. +type PartnerDestinationsClientActivateResponse struct { + PartnerDestination +} + +// PartnerDestinationsClientCreateOrUpdateResponse contains the response from method PartnerDestinationsClient.BeginCreateOrUpdate. +type PartnerDestinationsClientCreateOrUpdateResponse struct { + 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 { + PartnerDestination +} + +// PartnerDestinationsClientListByResourceGroupResponse contains the response from method PartnerDestinationsClient.NewListByResourceGroupPager. +type PartnerDestinationsClientListByResourceGroupResponse struct { + PartnerDestinationsListResult +} + +// PartnerDestinationsClientListBySubscriptionResponse contains the response from method PartnerDestinationsClient.NewListBySubscriptionPager. +type PartnerDestinationsClientListBySubscriptionResponse struct { + PartnerDestinationsListResult +} + +// PartnerDestinationsClientUpdateResponse contains the response from method PartnerDestinationsClient.BeginUpdate. +type PartnerDestinationsClientUpdateResponse struct { + PartnerDestination +} + // PartnerNamespacesClientCreateOrUpdateResponse contains the response from method PartnerNamespacesClient.BeginCreateOrUpdate. type PartnerNamespacesClientCreateOrUpdateResponse struct { PartnerNamespace @@ -444,6 +639,26 @@ type PartnerTopicsClientUpdateResponse struct { PartnerTopic } +// PermissionBindingsClientCreateOrUpdateResponse contains the response from method PermissionBindingsClient.BeginCreateOrUpdate. +type PermissionBindingsClientCreateOrUpdateResponse struct { + PermissionBinding +} + +// PermissionBindingsClientDeleteResponse contains the response from method PermissionBindingsClient.BeginDelete. +type PermissionBindingsClientDeleteResponse struct { + // placeholder for future response values +} + +// PermissionBindingsClientGetResponse contains the response from method PermissionBindingsClient.Get. +type PermissionBindingsClientGetResponse struct { + PermissionBinding +} + +// PermissionBindingsClientListByNamespaceResponse contains the response from method PermissionBindingsClient.NewListByNamespacePager. +type PermissionBindingsClientListByNamespaceResponse struct { + PermissionBindingsListResult +} + // PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. type PrivateEndpointConnectionsClientDeleteResponse struct { // placeholder for future response values @@ -574,6 +789,26 @@ type TopicEventSubscriptionsClientUpdateResponse struct { EventSubscription } +// TopicSpacesClientCreateOrUpdateResponse contains the response from method TopicSpacesClient.BeginCreateOrUpdate. +type TopicSpacesClientCreateOrUpdateResponse struct { + TopicSpace +} + +// TopicSpacesClientDeleteResponse contains the response from method TopicSpacesClient.BeginDelete. +type TopicSpacesClientDeleteResponse struct { + // placeholder for future response values +} + +// TopicSpacesClientGetResponse contains the response from method TopicSpacesClient.Get. +type TopicSpacesClientGetResponse struct { + TopicSpace +} + +// TopicSpacesClientListByNamespaceResponse contains the response from method TopicSpacesClient.NewListByNamespacePager. +type TopicSpacesClientListByNamespaceResponse struct { + TopicSpacesListResult +} + // TopicTypesClientGetResponse contains the response from method TopicTypesClient.Get. type TopicTypesClientGetResponse struct { TopicTypeInfo diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go index 25a8140556f7..13ed65053d68 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopiceventsubscriptions_client.go @@ -50,7 +50,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -74,7 +74,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *SystemTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *SystemTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -114,7 +114,7 @@ func (client *SystemTopicEventSubscriptionsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) @@ -123,7 +123,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -145,7 +145,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *SystemTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, options *SystemTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, systemTopicName, eventSubscriptionName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *SystemTopicEventSubscriptionsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -193,7 +193,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -239,7 +239,7 @@ func (client *SystemTopicEventSubscriptionsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +257,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -303,7 +303,7 @@ func (client *SystemTopicEventSubscriptionsClient) getDeliveryAttributesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -367,7 +367,7 @@ func (client *SystemTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +384,7 @@ func (client *SystemTopicEventSubscriptionsClient) getFullURLHandleResponse(resp // NewListBySystemTopicPager - List event subscriptions that belong to a specific system topic. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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 @@ -437,7 +437,7 @@ func (client *SystemTopicEventSubscriptionsClient) listBySystemTopicCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -461,7 +461,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -484,7 +484,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *SystemTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *SystemTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -524,7 +524,7 @@ func (client *SystemTopicEventSubscriptionsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) 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 b5392925af70..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 a9e4173ac1e3..fcf92cb06b89 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/systemtopics_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - systemTopicInfo - System Topic information. @@ -70,7 +70,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *SystemTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, systemTopicName string, systemTopicInfo SystemTopic, options *SystemTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, systemTopicName, systemTopicInfo, options) if err != nil { @@ -106,7 +106,7 @@ func (client *SystemTopicsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, systemTopicInfo) @@ -115,7 +115,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -135,7 +135,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *SystemTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, systemTopicName string, options *SystemTopicsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, systemTopicName, options) if err != nil { @@ -171,7 +171,7 @@ func (client *SystemTopicsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -179,7 +179,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -218,7 +218,7 @@ func (client *SystemTopicsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *SystemTopicsClient) getHandleResponse(resp *http.Response) (System // NewListByResourceGroupPager - List all the system topics under a resource group. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -283,7 +283,7 @@ func (client *SystemTopicsClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -306,7 +306,7 @@ func (client *SystemTopicsClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List all the system topics under an Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - SystemTopicsClientListBySubscriptionOptions contains the optional parameters for the SystemTopicsClient.NewListBySubscriptionPager // method. func (client *SystemTopicsClient) NewListBySubscriptionPager(options *SystemTopicsClientListBySubscriptionOptions) *runtime.Pager[SystemTopicsClientListBySubscriptionResponse] { @@ -349,7 +349,7 @@ func (client *SystemTopicsClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -373,7 +373,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - systemTopicName - Name of the system topic. // - systemTopicUpdateParameters - SystemTopic update information. @@ -394,7 +394,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *SystemTopicsClient) update(ctx context.Context, resourceGroupName string, systemTopicName string, systemTopicUpdateParameters SystemTopicUpdateParameters, options *SystemTopicsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, systemTopicName, systemTopicUpdateParameters, options) if err != nil { @@ -430,7 +430,7 @@ func (client *SystemTopicsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, systemTopicUpdateParameters) 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 52ad6ee52239..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 068b559fa955..1bca4257af6d 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topiceventsubscriptions_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-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 100 @@ -72,7 +72,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *TopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *TopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -112,7 +112,7 @@ func (client *TopicEventSubscriptionsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) @@ -121,7 +121,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 2022-06-15 +// Generated from API version 2023-06-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. Event subscription names must be between 3 and 100 @@ -143,7 +143,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *TopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, options) if err != nil { @@ -183,7 +183,7 @@ func (client *TopicEventSubscriptionsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -191,9 +191,9 @@ 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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. -// - topicName - Name of the partner topic. +// - topicName - Name of the topic. // - eventSubscriptionName - Name of the event subscription to be found. Event subscription names must be between 3 and 100 // characters in length and use alphanumeric letters only. // - options - TopicEventSubscriptionsClientGetOptions contains the optional parameters for the TopicEventSubscriptionsClient.Get @@ -237,7 +237,7 @@ func (client *TopicEventSubscriptionsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,9 +255,9 @@ 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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. -// - topicName - Name of the domain topic. +// - topicName - Name of the topic. // - eventSubscriptionName - Name of the event subscription. // - options - TopicEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the TopicEventSubscriptionsClient.GetDeliveryAttributes // method. @@ -300,7 +300,7 @@ func (client *TopicEventSubscriptionsClient) getDeliveryAttributesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,7 +318,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -363,7 +363,7 @@ func (client *TopicEventSubscriptionsClient) getFullURLCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *TopicEventSubscriptionsClient) getFullURLHandleResponse(resp *http // NewListPager - List all event subscriptions that have been created for a specific topic. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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 @@ -433,7 +433,7 @@ func (client *TopicEventSubscriptionsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -457,7 +457,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -479,7 +479,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *TopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *TopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -519,7 +519,7 @@ func (client *TopicEventSubscriptionsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) 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 2d03ef89f935..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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", "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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 4cec8c5abc8c..bde420a07cb9 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topics_client.go @@ -49,7 +49,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - topicInfo - Topic information. @@ -70,7 +70,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *TopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, topicName string, topicInfo Topic, options *TopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, topicName, topicInfo, options) if err != nil { @@ -106,7 +106,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, topicInfo) @@ -115,7 +115,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -134,7 +134,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *TopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, topicName string, options *TopicsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, topicName, options) if err != nil { @@ -170,7 +170,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -178,7 +178,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -217,7 +217,7 @@ func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *TopicsClient) getHandleResponse(resp *http.Response) (TopicsClient // NewListByResourceGroupPager - List all the topics under a resource group. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -282,7 +282,7 @@ func (client *TopicsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -305,7 +305,7 @@ func (client *TopicsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - List all the topics under an Azure subscription. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - TopicsClientListBySubscriptionOptions contains the optional parameters for the TopicsClient.NewListBySubscriptionPager // method. func (client *TopicsClient) NewListBySubscriptionPager(options *TopicsClientListBySubscriptionOptions) *runtime.Pager[TopicsClientListBySubscriptionResponse] { @@ -348,7 +348,7 @@ func (client *TopicsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -371,7 +371,7 @@ func (client *TopicsClient) listBySubscriptionHandleResponse(resp *http.Response // NewListEventTypesPager - List event types for a topic. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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. @@ -428,7 +428,7 @@ func (client *TopicsClient) listEventTypesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,7 +446,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 2022-06-15 +// Generated from API version 2023-06-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 @@ -486,7 +486,7 @@ func (client *TopicsClient) listSharedAccessKeysCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -504,7 +504,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 2022-06-15 +// Generated from API version 2023-06-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. @@ -525,7 +525,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *TopicsClient) regenerateKey(ctx context.Context, resourceGroupName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest, options *TopicsClientBeginRegenerateKeyOptions) (*http.Response, error) { req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, topicName, regenerateKeyRequest, options) if err != nil { @@ -561,7 +561,7 @@ func (client *TopicsClient) regenerateKeyCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) @@ -570,7 +570,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 2022-06-15 +// Generated from API version 2023-06-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. // - topicName - Name of the topic. // - topicUpdateParameters - Topic update information. @@ -590,7 +590,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 2022-06-15 +// Generated from API version 2023-06-01-preview func (client *TopicsClient) update(ctx context.Context, resourceGroupName string, topicName string, topicUpdateParameters TopicUpdateParameters, options *TopicsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, topicName, topicUpdateParameters, options) if err != nil { @@ -626,7 +626,7 @@ func (client *TopicsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, topicUpdateParameters) 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 d43ae8d11ad1..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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", "exampletopic1", 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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 new file mode 100644 index 000000000000..9d2ce58dfc85 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topicspaces_client.go @@ -0,0 +1,329 @@ +//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 + +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" +) + +// TopicSpacesClient contains the methods for the TopicSpaces group. +// Don't use this type directly, use NewTopicSpacesClient() instead. +type TopicSpacesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewTopicSpacesClient creates a new instance of TopicSpacesClient 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 NewTopicSpacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TopicSpacesClient, error) { + cl, err := arm.NewClient(moduleName+".TopicSpacesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &TopicSpacesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2023-06-01-preview +// - resourceGroupName - The name of the resource group within the user's subscription. +// - namespaceName - Name of the namespace. +// - topicSpaceName - The topic space name. +// - topicSpaceInfo - Topic space information. +// - options - TopicSpacesClientBeginCreateOrUpdateOptions contains the optional parameters for the TopicSpacesClient.BeginCreateOrUpdate +// method. +func (client *TopicSpacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, topicSpaceInfo TopicSpace, options *TopicSpacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[TopicSpacesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, topicSpaceName, topicSpaceInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TopicSpacesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[TopicSpacesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 2023-06-01-preview +func (client *TopicSpacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, topicSpaceInfo TopicSpace, options *TopicSpacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, topicSpaceName, topicSpaceInfo, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *TopicSpacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, topicSpaceInfo TopicSpace, options *TopicSpacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topicSpaces/{topicSpaceName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicSpaceName == "" { + return nil, errors.New("parameter topicSpaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicSpaceName}", url.PathEscape(topicSpaceName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, topicSpaceInfo) +} + +// BeginDelete - Delete an existing topic space. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - TopicSpacesClientBeginDeleteOptions contains the optional parameters for the TopicSpacesClient.BeginDelete method. +func (client *TopicSpacesClient) BeginDelete(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, options *TopicSpacesClientBeginDeleteOptions) (*runtime.Poller[TopicSpacesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, namespaceName, topicSpaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TopicSpacesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[TopicSpacesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete an existing topic space. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +func (client *TopicSpacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, options *TopicSpacesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, topicSpaceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *TopicSpacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, options *TopicSpacesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topicSpaces/{topicSpaceName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicSpaceName == "" { + return nil, errors.New("parameter topicSpaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicSpaceName}", url.PathEscape(topicSpaceName)) + 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", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of a topic space. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-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. +// - options - TopicSpacesClientGetOptions contains the optional parameters for the TopicSpacesClient.Get method. +func (client *TopicSpacesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, options *TopicSpacesClientGetOptions) (TopicSpacesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, topicSpaceName, options) + if err != nil { + return TopicSpacesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return TopicSpacesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TopicSpacesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *TopicSpacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, topicSpaceName string, options *TopicSpacesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topicSpaces/{topicSpaceName}" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if topicSpaceName == "" { + return nil, errors.New("parameter topicSpaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicSpaceName}", url.PathEscape(topicSpaceName)) + 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", "2023-06-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 *TopicSpacesClient) getHandleResponse(resp *http.Response) (TopicSpacesClientGetResponse, error) { + result := TopicSpacesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TopicSpace); err != nil { + return TopicSpacesClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespacePager - Get all the topic spaces under a namespace. +// +// Generated from API version 2023-06-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 +// method. +func (client *TopicSpacesClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *TopicSpacesClientListByNamespaceOptions) *runtime.Pager[TopicSpacesClientListByNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[TopicSpacesClientListByNamespaceResponse]{ + More: func(page TopicSpacesClientListByNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TopicSpacesClientListByNamespaceResponse) (TopicSpacesClientListByNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return TopicSpacesClientListByNamespaceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return TopicSpacesClientListByNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TopicSpacesClientListByNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceHandleResponse(resp) + }, + }) +} + +// listByNamespaceCreateRequest creates the ListByNamespace request. +func (client *TopicSpacesClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *TopicSpacesClientListByNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/topicSpaces" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + 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", "2023-06-01-preview") + 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)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceHandleResponse handles the ListByNamespace response. +func (client *TopicSpacesClient) listByNamespaceHandleResponse(resp *http.Response) (TopicSpacesClientListByNamespaceResponse, error) { + result := TopicSpacesClientListByNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TopicSpacesListResult); err != nil { + return TopicSpacesClientListByNamespaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go index 43cb9b9cabe0..63c48deed4e0 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/topictypes_client.go @@ -44,7 +44,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 2022-06-15 +// Generated from API version 2023-06-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) { @@ -74,7 +74,7 @@ func (client *TopicTypesClient) getCreateRequest(ctx context.Context, topicTypeN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -91,7 +91,7 @@ func (client *TopicTypesClient) getHandleResponse(resp *http.Response) (TopicTyp // NewListPager - List all registered topic types. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-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]{ @@ -123,7 +123,7 @@ func (client *TopicTypesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -140,7 +140,7 @@ func (client *TopicTypesClient) listHandleResponse(resp *http.Response) (TopicTy // NewListEventTypesPager - List event types for a topic type. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - topicTypeName - Name of the topic type. // - options - TopicTypesClientListEventTypesOptions contains the optional parameters for the TopicTypesClient.NewListEventTypesPager // method. @@ -178,7 +178,7 @@ func (client *TopicTypesClient) listEventTypesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-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 65bbf379811c..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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 a0ea315232ae..efbadc205c6a 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/verifiedpartners_client.go @@ -45,7 +45,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 2022-06-15 +// Generated from API version 2023-06-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) { @@ -75,7 +75,7 @@ func (client *VerifiedPartnersClient) getCreateRequest(ctx context.Context, veri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -92,7 +92,7 @@ func (client *VerifiedPartnersClient) getHandleResponse(resp *http.Response) (Ve // NewListPager - Get a list of all verified partners. // -// Generated from API version 2022-06-15 +// Generated from API version 2023-06-01-preview // - options - VerifiedPartnersClientListOptions contains the optional parameters for the VerifiedPartnersClient.NewListPager // method. func (client *VerifiedPartnersClient) NewListPager(options *VerifiedPartnersClientListOptions) *runtime.Pager[VerifiedPartnersClientListResponse] { @@ -131,7 +131,7 @@ func (client *VerifiedPartnersClient) listCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-15") + reqQP.Set("api-version", "2023-06-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } 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 5dabe18dcf27..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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/f88928d723133dc392e3297e6d61b7f6d10501fd/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-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/"), - // }, - // }, - // }}, - // } - } -}